@@ -37,32 +37,43 @@ describe('semantic search DropdownView', function() {
37
37
expect ( view . $ ( 'optgroup:nth-child(2)' ) . prop ( 'label' ) ) . toBe ( 'apply logic' ) ;
38
38
expect ( view . $ ( 'optgroup:nth-child(2) option' ) . length ) . toBe ( 3 ) ;
39
39
expect ( view . $ ( 'optgroup:nth-child(3)' ) . prop ( 'label' ) ) . toBe ( 'expect type' ) ;
40
- expect ( view . $ ( 'optgroup:nth-child(3) option' ) . length ) . toBe ( 3 ) ;
40
+ expect ( view . $ ( 'optgroup:nth-child(3) option' ) . length ) . toBe ( 4 ) ;
41
41
expect ( view . $ ( 'optgroup:nth-child(3)' ) . text ( ) ) . toContain ( 'Reader' ) ;
42
- expect ( view . $ ( 'optgroup:nth-child(3)' ) . text ( ) ) . not . toContain ( 'Person' ) ;
42
+ expect ( view . $ ( 'optgroup:nth-child(3)' ) . text ( ) ) . toContain ( 'Person' ) ;
43
43
} ) ;
44
44
45
- each ( {
46
- 'single class' : 'Reader' ,
47
- 'property' : 'descriptionOf' ,
48
- } , ( term , label ) =>
49
- it ( `can be constructed with a ${ label } ` , async function ( ) {
50
- const model = new Model ( {
51
- precedent : ldChannel . request ( 'obtain' , readit ( term ) ) ,
52
- } ) ;
53
- const view = new Dropdown ( { model } ) ;
54
- await event ( view , 'ready' ) ;
55
- await event ( view . predicateGroup . collection . at ( 0 ) , 'change:classLabel' ) ;
56
- expect ( view . $ ( 'select optgroup' ) . length ) . toBe ( 3 ) ;
57
- expect ( view . $ ( 'optgroup:nth-child(2)' ) . prop ( 'label' ) ) . toBe ( 'apply logic' ) ;
58
- expect ( view . $ ( 'optgroup:nth-child(2) option' ) . length ) . toBe ( 3 ) ;
59
- expect ( view . $ ( 'optgroup:nth-child(3)' ) . prop ( 'label' ) ) . toBe ( 'apply filter' ) ;
60
- expect ( view . $ ( 'optgroup:nth-child(3) option' ) . length ) . toBe ( 2 ) ;
61
- expect ( view . $ ( 'optgroup:nth-child(3)' ) . text ( ) ) . toContain ( 'Is exactly' ) ;
62
- expect ( view . $ ( 'optgroup:nth-child(3)' ) . text ( ) ) . not . toContain ( 'Is less than' ) ;
63
- expect ( view . $ ( 'optgroup:nth-child(4)' ) . prop ( 'label' ) ) . toBe ( 'traverse predicate' ) ;
64
- expect ( view . $ ( 'optgroup:nth-child(4) option' ) . length ) . toBe ( 2 ) ;
65
- expect ( view . $ ( 'optgroup:nth-child(4)' ) . text ( ) ) . toContain ( 'description of' ) ;
66
- } )
67
- ) ;
45
+ it ( 'can be constructed with a property' , async function ( ) {
46
+ const model = new Model ( {
47
+ precedent : ldChannel . request ( 'obtain' , readit ( 'descriptionOf' ) ) ,
48
+ } ) ;
49
+ const view = new Dropdown ( { model } ) ;
50
+ await event ( view , 'ready' ) ;
51
+ await event ( view . typeGroup . collection , 'complete:all' ) ;
52
+ expect ( view . $ ( 'select optgroup' ) . length ) . toBe ( 2 ) ;
53
+ expect ( view . $ ( 'optgroup:nth-child(2)' ) . prop ( 'label' ) ) . toBe ( 'apply logic' ) ;
54
+ expect ( view . $ ( 'optgroup:nth-child(2) option' ) . length ) . toBe ( 3 ) ;
55
+ expect ( view . $ ( 'optgroup:nth-child(3)' ) . prop ( 'label' ) ) . toBe ( 'expect type' ) ;
56
+ expect ( view . $ ( 'optgroup:nth-child(3) option' ) . length ) . toBe ( 2 ) ;
57
+ expect ( view . $ ( 'optgroup:nth-child(3)' ) . text ( ) ) . toContain ( 'Reader' ) ;
58
+ expect ( view . $ ( 'optgroup:nth-child(3)' ) . text ( ) ) . toContain ( 'Person' ) ;
59
+ } ) ;
60
+
61
+ it ( `can be constructed with a single class` , async function ( ) {
62
+ const model = new Model ( {
63
+ precedent : ldChannel . request ( 'obtain' , readit ( 'Reader' ) ) ,
64
+ } ) ;
65
+ const view = new Dropdown ( { model } ) ;
66
+ await event ( view , 'ready' ) ;
67
+ await event ( view . predicateGroup . collection . at ( 0 ) , 'change:classLabel' ) ;
68
+ expect ( view . $ ( 'select optgroup' ) . length ) . toBe ( 3 ) ;
69
+ expect ( view . $ ( 'optgroup:nth-child(2)' ) . prop ( 'label' ) ) . toBe ( 'apply logic' ) ;
70
+ expect ( view . $ ( 'optgroup:nth-child(2) option' ) . length ) . toBe ( 3 ) ;
71
+ expect ( view . $ ( 'optgroup:nth-child(3)' ) . prop ( 'label' ) ) . toBe ( 'apply filter' ) ;
72
+ expect ( view . $ ( 'optgroup:nth-child(3) option' ) . length ) . toBe ( 2 ) ;
73
+ expect ( view . $ ( 'optgroup:nth-child(3)' ) . text ( ) ) . toContain ( 'Is exactly' ) ;
74
+ expect ( view . $ ( 'optgroup:nth-child(3)' ) . text ( ) ) . not . toContain ( 'Is less than' ) ;
75
+ expect ( view . $ ( 'optgroup:nth-child(4)' ) . prop ( 'label' ) ) . toBe ( 'traverse predicate' ) ;
76
+ expect ( view . $ ( 'optgroup:nth-child(4) option' ) . length ) . toBe ( 2 ) ;
77
+ expect ( view . $ ( 'optgroup:nth-child(4)' ) . text ( ) ) . toContain ( 'description of' ) ;
78
+ } ) ;
68
79
} ) ;
0 commit comments