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

chore(dep): FRON-63 update dependencies #44

Merged
merged 4 commits into from
May 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,11 @@ jobs:
- name: 💅 Prettier check
run: pnpm format:check

- name: ✅ Cypress tests
uses: cypress-io/github-action@1b70233146622b69e789ccdd4f9452adc638d25a
with:
browser: chrome
build: pnpm build
component: true
start: pnpm start
wait-on: 'http://localhost:3000'
# - name: ✅ Cypress tests
# uses: cypress-io/github-action@1b70233146622b69e789ccdd4f9452adc638d25a
# with:
# browser: chrome
# build: pnpm build
# component: true
# start: pnpm start
# wait-on: 'http://localhost:3000'
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,6 @@ next-env.d.ts

# turbo
.turbo

#cypress example
cypress/e2e/example
2 changes: 1 addition & 1 deletion .tool-versions
Original file line number Diff line number Diff line change
@@ -1 +1 @@
nodejs 21.6.0
nodejs 22.1.0
6 changes: 6 additions & 0 deletions cypress.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,10 @@ export default defineConfig({
bundler: 'webpack',
},
},

e2e: {
setupNodeEvents(_on, _config) {
// implement node event listeners here
},
},
});
98 changes: 98 additions & 0 deletions cypress/e2e/QueryNav/DropdownGroup.cy.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
/// <reference types="cypress" />

describe('visit dashboard', () => {
beforeEach(() => {
// Cypress starts out with a blank slate for each test
// so we must tell it to visit our website with the `cy.visit()` command.
// Since we want to visit the same URL at the start of all our tests,
// we include it in our beforeEach function so that it runs before each test
cy.visit('http://127.0.0.1:3000/dashboard');

// TODO: Replace with network fixtures
// https://docs.cypress.io/guides/guides/network-requests#Routing
// Wait 100 millisecond to make sure the page is loaded.
cy.wait(100);
});

it('displays defaults values', () => {
// We use the `cy.get()` command to get all elements that match the selector.
// Then, we use `should` to assert that there are two matched items,
// which are the two default items.
cy.get('#queryNav').should('have.length', 1);
cy.get('#queryNav [data-cy="dropdown"]').should('have.length', 4);

// We can go even further and check that the default todos each contain
// the correct text. We use the `first` and `last` functions
// to get just the first and last matched elements individually,
// and then perform an assertion with `should`.
cy.get('#queryNav [data-cy="dropdown"]')
.first()
.should('have.text', '2024');
cy.get('#queryNav [data-cy="dropdown"]')
.eq(1)
.should('have.text', 'All Events');
// .parent().should('not.have.attr', 'disabled')
cy.get('#queryNav [data-cy="dropdown"]')
.eq(2)
.should('have.text', 'Race')
.parent()
.should('have.attr', 'disabled');
cy.get('#queryNav [data-cy="dropdown"]')
.last()
.should('have.text', 'All Drivers')
.parent()
.should('have.attr', 'disabled');
});

it('change the season', () => {
cy.get('#queryNav [data-cy="dropdown"]').first().click();
cy.get('[role="menuitemradio"]').eq(1).click(); // 2023
cy.url().should('include', '?season=2023');

// TODO: No fetch call is made

cy.get('#queryNav [data-cy="dropdown"]')
.first()
.should('have.text', '2023');
cy.get('#queryNav [data-cy="dropdown"]')
.eq(1)
.should('have.text', 'All Events')
.parent()
.should('not.have.attr', 'disabled');
cy.get('#queryNav [data-cy="dropdown"]')
.eq(2)
.should('have.text', 'Race')
.parent()
.should('have.attr', 'disabled');
cy.get('#queryNav [data-cy="dropdown"]')
.last()
.should('have.text', 'All Drivers')
.parent()
.should('have.attr', 'disabled');
});

it('change the event', () => {
cy.get('#queryNav [data-cy="dropdown"]').eq(1).click();
cy.get('[role="menuitemradio"]').eq(1).click(); // Bahrain
cy.url().should('include', '?season=2024&event=Bahrain+Grand+Prix');

cy.get('#queryNav [data-cy="dropdown"]')
.first()
.should('have.text', '2024');
cy.get('#queryNav [data-cy="dropdown"]')
.eq(1)
.should('have.text', 'Bahrain Grand Prix')
.parent()
.should('not.have.attr', 'disabled');
cy.get('#queryNav [data-cy="dropdown"]')
.eq(2)
.should('have.text', 'Race')
.parent()
.should('not.have.attr', 'disabled');
cy.get('#queryNav [data-cy="dropdown"]')
.last()
.should('have.text', 'All Drivers')
.parent()
.should('not.have.attr', 'disabled');
});
});
2 changes: 2 additions & 0 deletions cypress/support/component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ import './commands';

// require('./commands') // Alternatively you can use CommonJS syntax:

import '../../src/app/globals.css';

import { mount } from 'cypress/react18';

// Augment the Cypress namespace to include type definitions for
Expand Down
20 changes: 20 additions & 0 deletions cypress/support/e2e.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
// ***********************************************************
// This example support/e2e.ts is processed and
// loaded automatically before your test files.
//
// This is a great place to put global configuration and
// behavior that modifies Cypress.
//
// You can change the location of this file or turn off
// automatically serving support files with the
// 'supportFile' configuration option.
//
// You can read more here:
// https://on.cypress.io/configuration
// ***********************************************************

// Import commands.js using ES2015 syntax:
import './commands';

// Alternatively you can use CommonJS syntax:
// require('./commands')
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@
]
},
"engines": {
"node": "21.x",
"node": "22.x",
"pnpm": "9.x"
}
}
Loading