Skip to content
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

Open
wants to merge 15 commits into
base: master
Choose a base branch
from
Open

Workflow #6

wants to merge 15 commits into from

Conversation

VeronicaOS
Copy link
Owner

I have added eslint, prettier and different commit hooks, and then Jest and and cypress to later on do some testing

Copy link

@Fermain Fermain left a 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,
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"jest/globals": true,

This is not required as a global configuration

"extends": "eslint:recommended",
"overrides": [
{
"files": ["/*.cy.js", "/*.test.ts"],
Copy link

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"],
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"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/");
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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/");
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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");
Copy link

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) => { ... })
Copy link

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",
Copy link

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"
Copy link

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"
Copy link

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants