-
Notifications
You must be signed in to change notification settings - Fork 1
/
GreaterThanOrEqual.spec.ts
42 lines (41 loc) · 2.99 KB
/
GreaterThanOrEqual.spec.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
import * as selectively from "./index"
describe("greater than or equal", () => {
it("greater than or equal integers", () => {
expect(selectively.is({ class: selectively.greaterThanOrEqual("300") }, { id: "axb", class: "290" })).toBeFalsy()
expect(selectively.is({ class: selectively.greaterThanOrEqual("300") }, { id: "axb", class: "310" })).toBeTruthy()
expect(selectively.is({ class: selectively.greaterThanOrEqual(300) }, { id: "axb", class: "290" })).toBeFalsy()
expect(selectively.is({ class: selectively.greaterThanOrEqual(300) }, { id: "axb", class: "310" })).toBeTruthy()
expect(selectively.is({ class: selectively.greaterThanOrEqual("300") }, { id: "axb", class: 290 })).toBeFalsy()
expect(selectively.is({ class: selectively.greaterThanOrEqual("300") }, { id: "axb", class: 310 })).toBeTruthy()
expect(selectively.is({ class: selectively.greaterThanOrEqual(300) }, { id: "axb", class: 290 })).toBeFalsy()
expect(selectively.is({ class: selectively.greaterThanOrEqual(300) }, { id: "axb", class: 310 })).toBeTruthy()
})
it("greater than or equal decimals", () => {
expect(
selectively.is({ class: selectively.greaterThanOrEqual("300.1") }, { id: "axb", class: "300.01" })
).toBeFalsy()
expect(
selectively.is({ class: selectively.greaterThanOrEqual("300.1") }, { id: "axb", class: "300.11" })
).toBeTruthy()
expect(selectively.is({ class: selectively.greaterThanOrEqual(300.1) }, { id: "axb", class: "300.01" })).toBeFalsy()
expect(
selectively.is({ class: selectively.greaterThanOrEqual(300.1) }, { id: "axb", class: "300.11" })
).toBeTruthy()
expect(selectively.is({ class: selectively.greaterThanOrEqual("300.1") }, { id: "axb", class: 300.01 })).toBeFalsy()
expect(
selectively.is({ class: selectively.greaterThanOrEqual("300.1") }, { id: "axb", class: 300.11 })
).toBeTruthy()
expect(selectively.is({ class: selectively.greaterThanOrEqual(300.1) }, { id: "axb", class: 300.01 })).toBeFalsy()
expect(selectively.is({ class: selectively.greaterThanOrEqual(300.1) }, { id: "axb", class: 300.11 })).toBeTruthy()
})
it("greater than when equal", () => {
expect(selectively.is({ class: selectively.greaterThanOrEqual("300") }, { id: "axb", class: "300.0" })).toBeTruthy()
expect(selectively.is({ class: selectively.greaterThanOrEqual("300") }, { id: "axb", class: 300.0 })).toBeTruthy()
expect(selectively.is({ class: selectively.greaterThanOrEqual(300) }, { id: "axb", class: "300.0" })).toBeTruthy()
expect(selectively.is({ class: selectively.greaterThanOrEqual(300) }, { id: "axb", class: 300.0 })).toBeTruthy()
expect(selectively.is({ class: selectively.greaterThanOrEqual("300.0") }, { id: "axb", class: "300" })).toBeTruthy()
expect(selectively.is({ class: selectively.greaterThanOrEqual("300.0") }, { id: "axb", class: 300 })).toBeTruthy()
expect(selectively.is({ class: selectively.greaterThanOrEqual(300.0) }, { id: "axb", class: "300" })).toBeTruthy()
expect(selectively.is({ class: selectively.greaterThanOrEqual(300.0) }, { id: "axb", class: 300 })).toBeTruthy()
})
})