-
-
Notifications
You must be signed in to change notification settings - Fork 110
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Overall improvements and new features (GraphCMS) (#231)
- Loading branch information
1 parent
94d618b
commit 5ad05e8
Showing
178 changed files
with
6,049 additions
and
1,088 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
node_modules | ||
.next | ||
cypress | ||
src/**/*.test* | ||
src/gql/** | ||
src/propTypes/** | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/// <reference types="cypress" /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import { Customer } from '../../../../src/types/data/Customer'; | ||
import { CYPRESS_WINDOW_NS } from '../../../../src/utils/testing/cypress'; | ||
|
||
describe('Sanity checks > Browser data', () => { | ||
/** | ||
* Visits the home page before any test. | ||
*/ | ||
before(() => { | ||
cy.visit('/en'); | ||
}); | ||
|
||
/** | ||
* Prepare aliases before each test. (they're destroyed at the end of each test) | ||
*/ | ||
beforeEach(() => { | ||
cy.prepareDOMAliases(); | ||
}); | ||
|
||
it(`should have "window.${CYPRESS_WINDOW_NS}.dataset" defined`, () => { | ||
cy.get('@dataset').then((dataset) => { | ||
assert.isDefined(dataset); | ||
expect(Object.keys(dataset).length).to.be.greaterThan(0); | ||
}); | ||
}); | ||
|
||
it(`should have "window.${CYPRESS_WINDOW_NS}.customer" defined`, () => { | ||
cy.get<Customer>('@customer').then((customer: Customer) => { | ||
assert.isDefined(customer.label); | ||
}); | ||
}); | ||
}); |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
import { Customer } from '../../../../src/types/data/Customer'; | ||
|
||
const baseUrl = Cypress.config().baseUrl; | ||
|
||
describe('Common > Footer section', () => { | ||
/** | ||
* Visits the home page before any test. | ||
*/ | ||
before(() => { | ||
cy.visit('/en'); | ||
}); | ||
|
||
/** | ||
* Prepare aliases before each test. (they're destroyed at the end of each test) | ||
*/ | ||
beforeEach(() => { | ||
cy.prepareDOMAliases(); | ||
}); | ||
|
||
it('should have the Unly logo in the footer', () => { | ||
cy.get('#footer-logo-unly-brand').should('have.length', 1); | ||
}); | ||
|
||
it('should have the customer logo in the footer', () => { | ||
cy.get('#footer-logo').should('have.length', 1); | ||
}); | ||
|
||
it('should display the i18n button to change language', () => { | ||
cy.get<Customer>('@customer').then((customer: Customer) => { | ||
const availableLanguagesCount = 2; | ||
cy.log(`Available language(s): ${availableLanguagesCount}`); | ||
|
||
if (availableLanguagesCount > 1) { | ||
it('should have a button to change the language which changes the language upon click', () => { | ||
cy.get('#footer-btn-change-locale').should('have.length', 1).click({ force: true }); | ||
cy.url().should('eq', `${baseUrl}/fr`); | ||
}); | ||
} else { | ||
it('should not have a button to change the language', () => { | ||
cy.get('#footer-btn-change-locale').should('not.have.length', 1); | ||
}); | ||
} | ||
}); | ||
}); | ||
|
||
}); | ||
|
||
export {}; |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import { Customer } from '../../../../src/types/data/Customer'; | ||
|
||
const baseUrl = Cypress.config().baseUrl; | ||
|
||
describe('Common > Nav section', () => { | ||
/** | ||
* Visits the home page before any test. | ||
*/ | ||
before(() => { | ||
cy.visit('/en'); | ||
}); | ||
|
||
/** | ||
* Prepare aliases before each test. (they're destroyed at the end of each test) | ||
*/ | ||
beforeEach(() => { | ||
cy.prepareDOMAliases(); | ||
}); | ||
|
||
it('should have 3 links in the navigation bar', () => { | ||
cy.get('#nav .navbar-nav > .nav-item').should('have.length', 5); | ||
}); | ||
|
||
it('should have a link in the navbar that redirects to the home page', () => { | ||
cy.get<Customer>('@customer').then((customer: Customer) => { | ||
const isPageInEnglish = true; | ||
cy.get('#nav-link-home') | ||
.should('have.text', isPageInEnglish ? 'Home' : 'Accueil') | ||
.click(); | ||
cy.url({ timeout: 10000 }).should('eq', `${baseUrl}/${isPageInEnglish ? 'en' : 'fr'}`); | ||
}); | ||
}); | ||
}); | ||
|
||
export {}; |
15 changes: 12 additions & 3 deletions
15
cypress/integration/app/pages/index.js → cypress/integration/app/pages/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,23 @@ | ||
const baseUrl = Cypress.config().baseUrl; | ||
|
||
describe('Index page', () => { | ||
/* | ||
* Visits the home page before any test | ||
*/ | ||
/** | ||
* Visits the home page before any test. | ||
*/ | ||
before(() => { | ||
cy.visit('/en'); | ||
}); | ||
|
||
/** | ||
* Prepare aliases before each test. (they're destroyed at the end of each test) | ||
*/ | ||
beforeEach(() => { | ||
cy.prepareDOMAliases(); | ||
}); | ||
|
||
it('should display a main title', () => { | ||
cy.get('h1').should('have.length', 1).should('have.text', 'Next Right Now Demo'); | ||
}); | ||
}); | ||
|
||
export {}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
declare namespace Cypress { | ||
interface cy extends Chainable<undefined> { | ||
prepareDOMAliases: () => Chainable<Element>; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
{ | ||
"extends": "../tsconfig.json", | ||
"include": [ | ||
"./**/*.ts*" | ||
], | ||
"exclude": [], | ||
"compilerOptions": { | ||
"baseUrl": ".", | ||
"jsx": "react", | ||
"types": [ | ||
"cypress" | ||
], | ||
"sourceMap": false, | ||
"isolatedModules": true | ||
} | ||
} |
Oops, something went wrong.
5ad05e8
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not what you expected? Are your scores flaky? Run Lighthouse on Foo
If scores continue to be inconsistent consider running all audits on Foo