Skip to content

Commit bf4e747

Browse files
author
nick
committed
misc: add .gitignore + fix cypress files to match JS style guide
Commit ready for merge. - Legacy-Id: 19751
1 parent dddaebd commit bf4e747

File tree

5 files changed

+134
-119
lines changed

5 files changed

+134
-119
lines changed

.editorconfig

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ root = true
66

77
# Settings for IETF datatracker
88
# ---------------------------------------------------------
9+
# PEP8 Style
910

1011
[*]
1112
indent_style = space
@@ -18,6 +19,7 @@ insert_final_newline = false
1819

1920
# Settings for .github folder
2021
# ---------------------------------------------------------
22+
# GitHub Markdown Style
2123

2224
[.github/**]
2325
indent_style = space
@@ -29,11 +31,24 @@ insert_final_newline = true
2931

3032
# Settings for client-side JS / Vue files
3133
# ---------------------------------------------------------
34+
# StandardJS Style
3235

3336
[client/**]
3437
indent_style = space
3538
indent_size = 2
3639
end_of_line = lf
3740
charset = utf-8
3841
trim_trailing_whitespace = true
42+
insert_final_newline = true
43+
44+
# Settings for cypress tests
45+
# ---------------------------------------------------------
46+
# StandardJS Style
47+
48+
[cypress/**]
49+
indent_style = space
50+
indent_size = 2
51+
end_of_line = lf
52+
charset = utf-8
53+
trim_trailing_whitespace = true
3954
insert_final_newline = true
Lines changed: 80 additions & 80 deletions
Original file line numberDiff line numberDiff line change
@@ -1,103 +1,103 @@
11
/// <reference types="cypress" />
22

33
describe('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

6969
describe('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+
})
Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,27 @@
11
/// <reference types="cypress" />
22

33
describe('expertise', () => {
4-
before(() => {
5-
cy.visit('/nomcom/2021/expertise/')
6-
})
7-
8-
it('expertises with expandable panels should expand', () => {
9-
cy.get('.nomcom-req-positions-tabs > li > a').each($tab => {
10-
cy.wrap($tab).click()
11-
cy.wrap($tab).parent().should('have.class', 'active')
4+
before(() => {
5+
cy.visit('/nomcom/2021/expertise/')
6+
})
7+
8+
it('expertises with expandable panels should expand', () => {
9+
cy.get('.nomcom-req-positions-tabs > li > a').each($tab => {
10+
cy.wrap($tab).click()
11+
cy.wrap($tab).parent().should('have.class', 'active')
1212

13-
cy.wrap($tab).invoke('attr', 'href').then($tabId => {
14-
cy.get($tabId).should('have.class', 'tab-pane').and('have.class', 'active').and('be.visible')
13+
cy.wrap($tab).invoke('attr', 'href').then($tabId => {
14+
cy.get($tabId).should('have.class', 'tab-pane').and('have.class', 'active').and('be.visible')
1515

16-
cy.get($tabId).then($tabContent => {
17-
if ($tabContent.find('.generic_iesg_reqs_header').length) {
18-
cy.wrap($tabContent).find('.generic_iesg_reqs_header').click()
19-
cy.wrap($tabContent).find('.generic_iesg_reqs_header').invoke('attr', 'href').then($expandId => {
20-
cy.get($expandId).should('be.visible')
21-
})
22-
}
23-
})
16+
cy.get($tabId).then($tabContent => {
17+
if ($tabContent.find('.generic_iesg_reqs_header').length) {
18+
cy.wrap($tabContent).find('.generic_iesg_reqs_header').click()
19+
cy.wrap($tabContent).find('.generic_iesg_reqs_header').invoke('attr', 'href').then($expandId => {
20+
cy.get($expandId).should('be.visible')
2421
})
22+
}
2523
})
24+
})
2625
})
27-
})
26+
})
27+
})
Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
/// <reference types="cypress" />
22

33
describe('questionnaires', () => {
4-
before(() => {
5-
cy.visit('/nomcom/2021/questionnaires/')
6-
})
7-
8-
it('position tabs should display the appropriate panel on click', () => {
9-
cy.get('.nomcom-questnr-positions-tabs > li > a').each($tab => {
10-
cy.wrap($tab).click()
11-
cy.wrap($tab).parent().should('have.class', 'active')
4+
before(() => {
5+
cy.visit('/nomcom/2021/questionnaires/')
6+
})
7+
8+
it('position tabs should display the appropriate panel on click', () => {
9+
cy.get('.nomcom-questnr-positions-tabs > li > a').each($tab => {
10+
cy.wrap($tab).click()
11+
cy.wrap($tab).parent().should('have.class', 'active')
1212

13-
cy.wrap($tab).invoke('attr', 'href').then($tabId => {
14-
cy.get($tabId).should('have.class', 'tab-pane').and('have.class', 'active').and('be.visible')
15-
})
16-
})
13+
cy.wrap($tab).invoke('attr', 'href').then($tabId => {
14+
cy.get($tabId).should('have.class', 'tab-pane').and('have.class', 'active').and('be.visible')
15+
})
1716
})
18-
})
17+
})
18+
})

cypress/support/commands.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,10 @@
2525
// Cypress.Commands.overwrite('visit', (originalFn, url, options) => { ... })
2626

2727
Cypress.Commands.add('any', { prevSubject: 'element' }, (subject, size = 1) => {
28-
cy.wrap(subject).then(elementList => {
29-
elementList = (elementList.jquery) ? elementList.get() : elementList
30-
elementList = Cypress._.sampleSize(elementList, size)
31-
elementList = (elementList.length > 1) ? elementList : elementList[0]
32-
cy.wrap(elementList)
33-
})
34-
})
28+
cy.wrap(subject).then(elementList => {
29+
elementList = (elementList.jquery) ? elementList.get() : elementList
30+
elementList = Cypress._.sampleSize(elementList, size)
31+
elementList = (elementList.length > 1) ? elementList : elementList[0]
32+
cy.wrap(elementList)
33+
})
34+
})

0 commit comments

Comments
 (0)