Skip to content

Commit 8cc002c

Browse files
authored
Merge pull request #1 from creativecommons/main
bump
2 parents 3b4d8f6 + c469e8b commit 8cc002c

File tree

6 files changed

+67
-5
lines changed

6 files changed

+67
-5
lines changed

.eslintrc.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
module.exports = {
22
root: true,
33

4+
plugins: ['cypress'],
5+
46
env: {
57
node: true,
68
browser: true,
@@ -39,5 +41,6 @@ module.exports = {
3941
'@vue/standard',
4042
'prettier',
4143
'prettier/vue',
44+
"plugin:cypress/recommended"
4245
],
4346
}

jsconfig.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"types": ["cypress"]
3+
}

package-lock.json

Lines changed: 9 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@
4848
"cypress": "^6.3.0",
4949
"eslint": "^6.8.0",
5050
"eslint-config-prettier": "^7.2.0",
51+
"eslint-plugin-cypress": "^2.11.2",
5152
"eslint-plugin-import": "^2.22.0",
5253
"eslint-plugin-node": "^11.1.0",
5354
"eslint-plugin-prettier": "^3.3.1",

tests/cypress/integration/AttributionDetails._spec.js

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
// type definitions for Cypress object "cy"
2+
/// <reference types="cypress" />
3+
4+
// type definitions for custom commands like "createDefaultTodos"
5+
/// <reference types="../support/commands.js" />
6+
17
/* This Source Code Form is subject to the terms of the Creative Commons
28
* License Chooser
39
*/
@@ -47,9 +53,14 @@ describe('Attribution Details Step.vue', () => {
4753
cy.visit('/')
4854
cy.makeAChoice('.FS', 'no')
4955
cy.clickNext()
56+
57+
// Appropriate license step
58+
cy.get('.AL [type="checkbox"]').each($el => cy.wrap($el).check())
59+
cy.clickNext()
60+
5061
cy.makeAChoice('.BY', 'yes')
5162
cy.hasRecommendedLicense('CC BY 4.0')
52-
cy.hasStepsCount(6)
63+
cy.hasStepsCount(7)
5364
cy.clickNext()
5465
cy.makeAChoice('.NC', 'yes')
5566
cy.clickNext()
@@ -68,6 +79,7 @@ describe('Attribution Details Step.vue', () => {
6879
cy.visit('/')
6980
cy.makeAChoice('.FS', 'yes')
7081
cy.clickNext()
82+
7183
cy.get('select').select('CC0 1.0')
7284
cy.hasRecommendedLicense('CC0 1.0 Universal')
7385
cy.hasStepsCount(4)

tests/cypress/integration/Stepper._spec.js

Lines changed: 38 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,15 @@ describe('Stepper.vue', () => {
3434
cy.visit('/')
3535
cy.makeAChoice('.FS', 'no')
3636
cy.clickNext()
37+
38+
// Appropriate license step
39+
cy.get('.AL [type="checkbox"]').each($el => cy.wrap($el).check())
40+
cy.clickNext()
41+
42+
3743
cy.makeAChoice('.BY', 'no')
3844
cy.hasRecommendedLicense('CC0 1.0 Universal')
39-
cy.hasStepsCount(7)
45+
cy.hasStepsCount(8)
4046
cy.clickNext()
4147
cy.get('.NC').should('have.class', 'disabled')
4248
cy.get('.ND').should('have.class', 'disabled')
@@ -50,9 +56,14 @@ describe('Stepper.vue', () => {
5056
cy.visit('/')
5157
cy.makeAChoice('.FS', 'no')
5258
cy.clickNext()
59+
60+
// Appropriate license step
61+
cy.get('.AL [type="checkbox"]').each($el => cy.wrap($el).check())
62+
cy.clickNext()
63+
5364
cy.makeAChoice('.BY', 'yes')
5465
cy.hasRecommendedLicense('CC BY 4.0')
55-
cy.hasStepsCount(6)
66+
cy.hasStepsCount(7)
5667
cy.clickNext()
5768
cy.makeAChoice('.NC', 'yes')
5869
cy.clickNext()
@@ -68,6 +79,11 @@ describe('Stepper.vue', () => {
6879
cy.visit('/')
6980
cy.makeAChoice('.FS', 'no')
7081
cy.clickNext()
82+
83+
// Appropriate license step
84+
cy.get('.AL [type="checkbox"]').each($el => cy.wrap($el).check())
85+
cy.clickNext()
86+
7187
cy.makeAChoice('.BY', 'yes')
7288
cy.hasRecommendedLicense('CC BY 4.0')
7389
cy.clickNext()
@@ -85,6 +101,11 @@ describe('Stepper.vue', () => {
85101
cy.visit('/')
86102
cy.makeAChoice('.FS', 'no')
87103
cy.clickNext()
104+
105+
// Appropriate license step
106+
cy.get('.AL [type="checkbox"]').each($el => cy.wrap($el).check())
107+
cy.clickNext()
108+
88109
cy.makeAChoice('.BY', 'yes')
89110
cy.hasRecommendedLicense('CC BY 4.0')
90111
cy.clickNext()
@@ -103,6 +124,7 @@ describe('Stepper.vue', () => {
103124
cy.clickBack()
104125
cy.makeAChoice('.ND', 'yes')
105126
cy.clickNext()
127+
cy.makeAChoice('.SA', 'yes') // @todo Fix this bug, must click yes before no to get it to switch
106128
cy.makeAChoice('.SA', 'no')
107129
cy.clickNext()
108130
cy.hasRecommendedLicense('CC BY-SA 4.0')
@@ -125,6 +147,12 @@ describe('Stepper.vue', () => {
125147
cy.clickBack()
126148
cy.makeAChoice('.FS', 'no')
127149
cy.clickNext()
150+
151+
// Appropriate license step
152+
cy.get('.AL [type="checkbox"]').each($el => cy.wrap($el).check())
153+
cy.clickNext()
154+
155+
128156
cy.makeAChoice('.BY', 'yes')
129157
cy.hasRecommendedLicense('CC BY 4.0')
130158
cy.clickNext()
@@ -153,6 +181,12 @@ describe('Stepper.vue', () => {
153181
cy.viewport('iphone-x')
154182
cy.makeAChoice('.FS', 'no')
155183
cy.clickNext()
184+
185+
// Appropriate license step
186+
cy.get('.AL [type="checkbox"]').each($el => cy.wrap($el).check())
187+
cy.clickNext()
188+
189+
156190
cy.makeAChoice('.BY', 'yes')
157191
cy.clickNext()
158192
cy.makeAChoice('.NC', 'yes')
@@ -162,12 +196,12 @@ describe('Stepper.vue', () => {
162196
cy.get('.SA').should('have.class', 'disabled')
163197
cy.hasRecommendedLicense('CC BY-ND 4.0')
164198
cy.window().then(($window) => {
165-
expect($window.scrollY).to.be.closeTo(800, 300)
199+
expect($window.scrollY).to.be.closeTo(800, 500)
166200
})
167201
cy.get('button').contains('DONE').click()
168202
cy.hasLicenseInAttributionCode('CC BY-ND 4.0')
169203
cy.window().then(($window) => {
170-
expect($window.scrollY).to.be.closeTo(1400, 300)
204+
expect($window.scrollY).to.be.closeTo(1400, 500)
171205
})
172206
})
173207
})

0 commit comments

Comments
 (0)