-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Workflow #6
base: master
Are you sure you want to change the base?
Workflow #6
Conversation
fixing tests
e2e testing complete
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.
Although this is not perfect, there is enough here to pass in my view.
"env": { | ||
"browser": true, | ||
"es2021": true, | ||
"jest/globals": true, |
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.
"jest/globals": true, |
This is not required as a global configuration
"extends": "eslint:recommended", | ||
"overrides": [ | ||
{ | ||
"files": ["/*.cy.js", "/*.test.ts"], |
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.
It looks like you have merged config for cypress and jest instead of giving these their own block.
"extends": "eslint:recommended", | ||
"overrides": [ | ||
{ | ||
"files": ["/*.cy.js", "/*.test.ts"], |
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.
"files": ["/*.cy.js", "/*.test.ts"], | |
"files": ["/*.cy.js", "/*.test.js"], |
Is the .ts
extension intentional?
@@ -0,0 +1,38 @@ | |||
describe("loginSuccessful", () => { | |||
beforeEach(() => { | |||
cy.visit("http://127.0.0.1:5500/"); |
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.
cy.visit("http://127.0.0.1:5500/"); | |
cy.visit("/"); |
@@ -0,0 +1,14 @@ | |||
describe("Logout function", () => { | |||
it("Logs in the user, logs out, and makes sure the login button exists afterwards.", () => { | |||
cy.visit("http://127.0.0.1:5500/"); |
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.
cy.visit("http://127.0.0.1:5500/"); | |
cy.visit("/"); |
cy.get("#loginForm button").contains("Login").click(); | ||
cy.wait(800); | ||
cy.get('button[data-auth="logout"]').click(); | ||
cy.get('.modal-footer button[data-auth="login"]').should("exist"); |
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.
You should check local storage here and assert a null token
// | ||
// | ||
// -- This is a child command -- | ||
// Cypress.Commands.add('drag', { prevSubject: 'element'}, (subject, options) => { ... }) |
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.
This file is worth using!
"bootstrap-dark-5": "^1.1.3" | ||
} | ||
"name": "css-frameworks-ca", | ||
"version": "1.0.0", |
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.
Version should increase with your changes
}, | ||
"dependencies": { | ||
"bootstrap-dark-5": "^1.1.3", | ||
"dotenv": "^16.4.5" |
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.
This is a dev dep
"dotenv": "^16.4.5" | ||
}, | ||
"lint-staged": { | ||
"*.js": "eslint --cache --fix" |
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.
Why not SCSS and HTML too?
I have added eslint, prettier and different commit hooks, and then Jest and and cypress to later on do some testing