File tree Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -28,4 +28,28 @@ describe('Array Operators', () => {
28
28
expect ( ArrayOperators . notIn ( 'rule' , [ ] ) ) . toBeTruthy ( )
29
29
} )
30
30
} )
31
+
32
+ describe ( 'Contains Operator' , ( ) => {
33
+ test ( 'Should pass given a filled array with the searched element' , ( ) => {
34
+ expect ( ArrayOperators . contains ( [ '*' , 'rule' ] , '*' ) ) . toBeTruthy ( )
35
+ } )
36
+
37
+ test ( 'Should fail given a filled array without the searched element' , ( ) => {
38
+ expect ( ArrayOperators . contains ( [ '*' , 'rule' ] , 'x' ) ) . toBeFalsy ( )
39
+ } )
40
+
41
+ test ( 'Should fail given an empty array' , ( ) => {
42
+ expect ( ArrayOperators . contains ( [ ] , 'x' ) ) . toBeFalsy ( )
43
+ } )
44
+ } )
45
+
46
+ describe ( 'DoesNotContain Operator' , ( ) => {
47
+ test ( 'Should fail given a filled array with the searched element' , ( ) => {
48
+ expect ( ArrayOperators . doesNotContain ( [ 'rule' ] , 'rule' ) ) . toBeFalsy ( )
49
+ } )
50
+
51
+ test ( 'Should pass given a filled array without the searched element' , ( ) => {
52
+ expect ( ArrayOperators . doesNotContain ( [ '*' ] , 'rule' ) ) . toBeTruthy ( )
53
+ } )
54
+ } )
31
55
} )
You can’t perform that action at this time.
0 commit comments