Skip to content

Commit

Permalink
fix smoketests
Browse files Browse the repository at this point in the history
  • Loading branch information
fpbrault committed Feb 10, 2025
1 parent 165af4b commit 0a5bde2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 12 deletions.
6 changes: 3 additions & 3 deletions packages/samples/headless-ssr/cypress/e2e/smoke.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ const msgSelector = '#hydrated-msg';
const timestampSelector = '#timestamp';
const resultListSelector = '.result-list li';
const searchBoxSelector = '.search-box input';
const routes = ['generic?tab=all', 'react?tab=all'] as const;
const routes = ['generic', 'react'] as const;

// Note: Thresholds might need to be adjusted as the page tested changes (e.g. more components are added etc)
const vitals: Record<(typeof routes)[number], Cypress.ReportWebVitalsConfig> = {
'generic?tab=all': {
generic: {
thresholds: {
lcp: 2500,
fid: 400,
Expand All @@ -26,7 +26,7 @@ const vitals: Record<(typeof routes)[number], Cypress.ReportWebVitalsConfig> = {
inp: 400,
},
},
'react?tab=all': {
react: {
thresholds: {
lcp: 2500,
fid: 800,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,6 @@ routes.forEach((route) => {
.as('initial-results');
});

it('should add the tab search parameter with the default value', () => {
cy.url().should((href) => {
const url = new URL(href);
expect(url.searchParams.size).to.equal(1);
expect(url.searchParams.has('tab', 'all'));
});
});

describe('after submitting a search', () => {
const query = 'abc';
beforeEach(() => {
Expand Down Expand Up @@ -62,7 +54,7 @@ routes.forEach((route) => {

it('should remove the search parameters', () => {
cy.url().should((href) =>
expect(new URL(href).searchParams.size).to.be.equal(1)
expect(new URL(href).searchParams.size).to.be.equal(0)
);
});

Expand Down

0 comments on commit 0a5bde2

Please sign in to comment.