-
Notifications
You must be signed in to change notification settings - Fork 1
/
LesserThan.spec.ts
34 lines (33 loc) · 2.74 KB
/
LesserThan.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
import * as selectively from "./index"
describe("lesser than", () => {
it("lesser than integers", () => {
expect(selectively.is({ class: selectively.lesserThan("300") }, { id: "axb", class: "290" })).toBeTruthy()
expect(selectively.is({ class: selectively.lesserThan("300") }, { id: "axb", class: "310" })).toBeFalsy()
expect(selectively.is({ class: selectively.lesserThan(300) }, { id: "axb", class: "290" })).toBeTruthy()
expect(selectively.is({ class: selectively.lesserThan(300) }, { id: "axb", class: "310" })).toBeFalsy()
expect(selectively.is({ class: selectively.lesserThan("300") }, { id: "axb", class: 290 })).toBeTruthy()
expect(selectively.is({ class: selectively.lesserThan("300") }, { id: "axb", class: 310 })).toBeFalsy()
expect(selectively.is({ class: selectively.lesserThan(300) }, { id: "axb", class: 290 })).toBeTruthy()
expect(selectively.is({ class: selectively.lesserThan(300) }, { id: "axb", class: 310 })).toBeFalsy()
})
it("lesser than decimals", () => {
expect(selectively.is({ class: selectively.lesserThan("300.1") }, { id: "axb", class: "300.01" })).toBeTruthy()
expect(selectively.is({ class: selectively.lesserThan("300.1") }, { id: "axb", class: "300.11" })).toBeFalsy()
expect(selectively.is({ class: selectively.lesserThan(300.1) }, { id: "axb", class: "300.01" })).toBeTruthy()
expect(selectively.is({ class: selectively.lesserThan(300.1) }, { id: "axb", class: "300.11" })).toBeFalsy()
expect(selectively.is({ class: selectively.lesserThan("300.1") }, { id: "axb", class: 300.01 })).toBeTruthy()
expect(selectively.is({ class: selectively.lesserThan("300.1") }, { id: "axb", class: 300.11 })).toBeFalsy()
expect(selectively.is({ class: selectively.lesserThan(300.1) }, { id: "axb", class: 300.01 })).toBeTruthy()
expect(selectively.is({ class: selectively.lesserThan(300.1) }, { id: "axb", class: 300.11 })).toBeFalsy()
})
it("lesser than when equal", () => {
expect(selectively.is({ class: selectively.lesserThan("300") }, { id: "axb", class: "300.0" })).toBeFalsy()
expect(selectively.is({ class: selectively.lesserThan("300") }, { id: "axb", class: 300.0 })).toBeFalsy()
expect(selectively.is({ class: selectively.lesserThan(300) }, { id: "axb", class: "300.0" })).toBeFalsy()
expect(selectively.is({ class: selectively.lesserThan(300) }, { id: "axb", class: 300.0 })).toBeFalsy()
expect(selectively.is({ class: selectively.lesserThan("300.0") }, { id: "axb", class: "300" })).toBeFalsy()
expect(selectively.is({ class: selectively.lesserThan("300.0") }, { id: "axb", class: 300 })).toBeFalsy()
expect(selectively.is({ class: selectively.lesserThan(300.0) }, { id: "axb", class: "300" })).toBeFalsy()
expect(selectively.is({ class: selectively.lesserThan(300.0) }, { id: "axb", class: 300 })).toBeFalsy()
})
})