Files
privacy.sexy/tests/e2e/initialization.cy.ts
undergroundwires bf3426f91b Fix card list UI layout shifts (jumps) on load
This commit fixes layout shifts that occur on card list part of the page
when the page is initially loaded.

- Resolve issue where card list starts with minimal width, leading
  to jumps in UI until correct width is calculated on medium and
  big screens.
- Dispose of existing `ResizeObserver` properly before creating a new
  one. This prevents leaks and incorrect width calculations if
  `containerElement` changes.
- Throttle resize events to minimize width/height calculation changes,
  enhancing performance and reducing the chances for layout shifts.

Supporting CI/CD improvements:

- Enable artifact upload in CI/CD even if E2E tests fail.
- Distinguish uploaded artifacts by operating system for clarity.
2023-11-16 16:06:33 +01:00

42 lines
1.1 KiB
TypeScript

import { waitForHeaderBrandTitle } from './shared/ApplicationLoad';
describe('application is initialized as expected', () => {
it('loads title as expected', () => {
// act
cy.visit('/');
// assert
waitForHeaderBrandTitle();
});
it('there are no console.error output', () => {
// act
// https://docs.cypress.io/faq/questions/using-cypress-faq#How-do-I-spy-on-console-log
cy.visit('/', {
onBeforeLoad(win) {
cy.stub(win.console, 'error').as('consoleError');
},
});
// assert
cy.get('@consoleError').should('have.not.been.called');
});
it('there are no console.warn output', () => {
// act
cy.visit('/', {
onBeforeLoad(win) {
cy.stub(win.console, 'warn').as('consoleWarn');
},
});
// assert
cy.get('@consoleWarn').should('have.not.been.called');
});
it('there are no console.log output', () => {
// act
cy.visit('/', {
onBeforeLoad(win) {
cy.stub(win.console, 'log').as('consoleLog');
},
});
// assert
cy.get('@consoleLog').should('have.not.been.called');
});
});