11/// <reference types="cypress" />
22
33describe ( 'meeting agenda' , ( ) => {
4- before ( ( ) => {
5- cy . visit ( '/meeting/agenda/' )
6- } )
7-
8- it ( 'toggle customize panel when clicking on customize header bar' , ( ) => {
9- cy . get ( '#agenda-filter-customize' ) . click ( )
10- cy . get ( '#customize' ) . should ( 'be.visible' ) . and ( 'have.class' , 'in' )
4+ before ( ( ) => {
5+ cy . visit ( '/meeting/agenda/' )
6+ } )
117
12- cy . get ( '#agenda-filter- customize' ) . click ( )
13- cy . get ( '#customize' ) . should ( 'not.be.visible' ) . and ( 'not.have.class' , 'in' )
14- } )
8+ it ( 'toggle customize panel when clicking on customize header bar' , ( ) => {
9+ cy . get ( '#agenda-filter- customize' ) . click ( )
10+ cy . get ( '#customize' ) . should ( 'be.visible' ) . and ( 'have.class' , 'in' )
1511
16- it ( 'customize panel should have at least 3 areas' , ( ) => {
17- cy . get ( '#agenda-filter-customize' ) . click ( )
18- cy . get ( '.agenda-filter-areaselectbtn' ) . should ( 'have.length.at.least' , 3 )
19- } )
12+ cy . get ( '#agenda-filter-customize' ) . click ( )
13+ cy . get ( '#customize' ) . should ( 'not.be.visible' ) . and ( 'not.have.class' , 'in' )
14+ } )
2015
21- it ( 'customize panel should have at least 10 groups' , ( ) => {
22- cy . get ( '.agenda-filter-groupselectbtn' ) . should ( 'have.length.at.least' , 10 )
23- } )
16+ it ( 'customize panel should have at least 3 areas' , ( ) => {
17+ cy . get ( '#agenda-filter-customize' ) . click ( )
18+ cy . get ( '.agenda-filter-areaselectbtn' ) . should ( 'have.length.at.least' , 3 )
19+ } )
2420
25- it ( 'filtering the agenda should modify the URL' , ( ) => {
26- // cy.intercept({
27- // method: 'GET',
28- // path: '/meeting/agenda/week-view.html**',
29- // times: 10
30- // }, {
31- // forceNetworkError: true
32- // })
21+ it ( 'customize panel should have at least 10 groups' , ( ) => {
22+ cy . get ( '.agenda-filter-groupselectbtn' ) . should ( 'have.length.at.least' , 10 )
23+ } )
3324
34- cy . get ( '.agenda-filter-groupselectbtn' ) . any ( 5 ) . as ( 'selectedGroups' ) . each ( randomElement => {
35- cy . wrap ( randomElement ) . click ( )
36- cy . wrap ( randomElement ) . invoke ( 'attr' , 'data-filter-item' ) . then ( keyword => {
37- cy . url ( ) . should ( 'contain' , keyword )
38- } )
39- } )
25+ it ( 'filtering the agenda should modify the URL' , ( ) => {
26+ // cy.intercept({
27+ // method: 'GET',
28+ // path: '/meeting/agenda/week-view.html**',
29+ // times: 10
30+ // }, {
31+ // forceNetworkError: true
32+ // })
4033
41- // Deselect everything
42- cy . get ( '@selectedGroups' ) . click ( { multiple : true } )
34+ cy . get ( '.agenda-filter-groupselectbtn' ) . any ( 5 ) . as ( 'selectedGroups' ) . each ( randomElement => {
35+ cy . wrap ( randomElement ) . click ( )
36+ cy . wrap ( randomElement ) . invoke ( 'attr' , 'data-filter-item' ) . then ( keyword => {
37+ cy . url ( ) . should ( 'contain' , keyword )
38+ } )
4339 } )
4440
45- it ( 'selecting an area should select all corresponding groups' , ( ) => {
46- cy . get ( '.agenda-filter-areaselectbtn' ) . any ( ) . click ( ) . invoke ( 'attr' , 'data-filter-item' ) . then ( area => {
47- cy . url ( ) . should ( 'contain' , area )
41+ // Deselect everything
42+ cy . get ( '@selectedGroups' ) . click ( { multiple : true } )
43+ } )
44+
45+ it ( 'selecting an area should select all corresponding groups' , ( ) => {
46+ cy . get ( '.agenda-filter-areaselectbtn' ) . any ( ) . click ( ) . invoke ( 'attr' , 'data-filter-item' ) . then ( area => {
47+ cy . url ( ) . should ( 'contain' , area )
4848
49- cy . get ( `.agenda-filter-groupselectbtn[data-filter-keywords*="${ area } "]` ) . each ( group => {
50- cy . wrap ( group ) . invoke ( 'attr' , 'data-filter-keywords' ) . then ( groupKeywords => {
51- // In case value is a comma-separated list of keywords...
52- if ( groupKeywords . indexOf ( ',' ) < 0 || groupKeywords . split ( ',' ) . includes ( area ) ) {
53- cy . wrap ( group ) . should ( 'have.class' , 'active' )
54- }
55- } )
56- } )
49+ cy . get ( `.agenda-filter-groupselectbtn[data-filter-keywords*="${ area } "]` ) . each ( group => {
50+ cy . wrap ( group ) . invoke ( 'attr' , 'data-filter-keywords' ) . then ( groupKeywords => {
51+ // In case value is a comma-separated list of keywords...
52+ if ( groupKeywords . indexOf ( ',' ) < 0 || groupKeywords . split ( ',' ) . includes ( area ) ) {
53+ cy . wrap ( group ) . should ( 'have.class' , 'active' )
54+ }
5755 } )
56+ } )
5857 } )
58+ } )
5959
60- it ( 'weekview iframe should load' , ( ) => {
61- cy . get ( 'iframe#weekview' ) . its ( '0.contentDocument' ) . should ( 'exist' )
62- cy . get ( 'iframe#weekview' ) . its ( '0.contentDocument.readyState' ) . should ( 'equal' , 'complete' )
63- cy . get ( 'iframe#weekview' ) . its ( '0.contentDocument.body' , {
64- timeout : 30000
65- } ) . should ( 'not.be.empty' )
66- } )
60+ it ( 'weekview iframe should load' , ( ) => {
61+ cy . get ( 'iframe#weekview' ) . its ( '0.contentDocument' ) . should ( 'exist' )
62+ cy . get ( 'iframe#weekview' ) . its ( '0.contentDocument.readyState' ) . should ( 'equal' , 'complete' )
63+ cy . get ( 'iframe#weekview' ) . its ( '0.contentDocument.body' , {
64+ timeout : 30000
65+ } ) . should ( 'not.be.empty' )
66+ } )
6767} )
6868
6969describe ( 'meeting agenda weekview' , ( ) => {
70- before ( ( ) => {
71- cy . visit ( '/meeting/agenda/week-view.html' )
72- } )
73- it ( 'should have day headers' , ( ) => {
74- cy . get ( '.agenda-weekview-day' ) . should ( 'have.length.greaterThan' , 0 ) . and ( 'be.visible' )
75- } )
76- it ( 'should have day columns' , ( ) => {
77- cy . get ( '.agenda-weekview-column' ) . should ( 'have.length.greaterThan' , 0 ) . and ( 'be.visible' )
78- } )
70+ before ( ( ) => {
71+ cy . visit ( '/meeting/agenda/week-view.html' )
72+ } )
73+ it ( 'should have day headers' , ( ) => {
74+ cy . get ( '.agenda-weekview-day' ) . should ( 'have.length.greaterThan' , 0 ) . and ( 'be.visible' )
75+ } )
76+ it ( 'should have day columns' , ( ) => {
77+ cy . get ( '.agenda-weekview-column' ) . should ( 'have.length.greaterThan' , 0 ) . and ( 'be.visible' )
78+ } )
7979
80- it ( 'should have the same number of day headers and columns' , ( ) => {
81- cy . get ( '.agenda-weekview-day' ) . its ( 'length' ) . then ( lgth => {
82- cy . get ( '.agenda-weekview-column' ) . should ( 'have.length' , lgth )
83- } )
80+ it ( 'should have the same number of day headers and columns' , ( ) => {
81+ cy . get ( '.agenda-weekview-day' ) . its ( 'length' ) . then ( lgth => {
82+ cy . get ( '.agenda-weekview-column' ) . should ( 'have.length' , lgth )
8483 } )
84+ } )
8585
86- it ( 'should have meetings' , ( ) => {
87- cy . get ( '.agenda-weekview-meeting' ) . should ( 'have.length.greaterThan' , 0 ) . and ( 'be.visible' )
88- } )
86+ it ( 'should have meetings' , ( ) => {
87+ cy . get ( '.agenda-weekview-meeting' ) . should ( 'have.length.greaterThan' , 0 ) . and ( 'be.visible' )
88+ } )
8989
90- it ( 'meeting hover should cause expansion to column width' , ( ) => {
91- cy . get ( '.agenda-weekview-column:first' ) . invoke ( 'outerWidth' ) . then ( colWidth => {
92- cy . get ( '.agenda-weekview-meeting-mini' ) . any ( 5 ) . each ( meeting => {
93- cy . wrap ( meeting )
94- . wait ( 250 )
95- . realHover ( { position : 'center' } )
96- . invoke ( 'outerWidth' )
97- . should ( 'be.closeTo' , colWidth , 1 )
98- // Move over to top left corner of the page to end the mouseover of the current meeting block
99- cy . get ( '.agenda-weekview-day:first' ) . realHover ( ) . wait ( 250 )
100- } )
101- } )
90+ it ( 'meeting hover should cause expansion to column width' , ( ) => {
91+ cy . get ( '.agenda-weekview-column:first' ) . invoke ( 'outerWidth' ) . then ( colWidth => {
92+ cy . get ( '.agenda-weekview-meeting-mini' ) . any ( 5 ) . each ( meeting => {
93+ cy . wrap ( meeting )
94+ . wait ( 250 )
95+ . realHover ( { position : 'center' } )
96+ . invoke ( 'outerWidth' )
97+ . should ( 'be.closeTo' , colWidth , 1 )
98+ // Move over to top left corner of the page to end the mouseover of the current meeting block
99+ cy . get ( '.agenda-weekview-day:first' ) . realHover ( ) . wait ( 250 )
100+ } )
102101 } )
103- } )
102+ } )
103+ } )
0 commit comments