Skip to content

Commit

Permalink
chore: fixes for firefox
Browse files Browse the repository at this point in the history
  • Loading branch information
yanfali committed Oct 23, 2024
1 parent 185c261 commit bdb2db2
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions tests/integration/localStorage.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { cy, describe, before, it } from 'local-cypress';
describe('Simple browsing', function () {
before(() => {
cy.viewport('macbook-15');
cy.intercept('https://keyboards.qmk.fm/v1/keyboard_list.json', () => {
cy.intercept('https://keyboards.qmk.fm/v1/keyboard_list.json', () => ({
keyboards: [
'1upkeyboards/1up60hse',
'1upkeyboards/1up60hte',
Expand All @@ -11,8 +11,8 @@ describe('Simple browsing', function () {
'1upkeyboards/sweet16',
'2_milk',
'30wer'
];
});
]
}));
});
it('Should load darkmode from localstorage', () => {
cy.clearLocalStorage();
Expand All @@ -32,7 +32,7 @@ describe('Simple browsing', function () {
cy.get('html[data-theme="dark"]', { timeout: 10000 }).should('be.visible');
});
it('Should set darkmode localstorage and reload it', () => {
cy.visit('/keebio/iris/rev1', {
cy.visit('/', {
onBeforeLoad(win) {
// force false, even if OS has requested change
cy.stub(win, 'matchMedia')
Expand All @@ -51,6 +51,7 @@ describe('Simple browsing', function () {
cy.get('.bes-controls', { timeout: 5000 }).click();
cy.get('#setting-toggle-darkmode').click();
cy.get('html[data-theme="dark"]', { timeout: 5000 }).should('be.visible');
cy.wait(500); // introduce wait, otherwise firefox cypress fails
cy.visit('/');
cy.get('html[data-theme="dark"]', { timeout: 5000 }).should('be.visible');
});
Expand Down Expand Up @@ -80,6 +81,7 @@ describe('Simple browsing', function () {
cy.get('.vs__dropdown-option.vs__dropdown-option--highlight').click();
cy.get('.vs__selected', { timeout: 5000 }).contains('2_milk');
cy.get('#favorite-keyboard').click();
cy.wait(500); // introduce wait, otherwise firefox cypress fails
cy.visit('/');
cy.get('.vs__selected', { timeout: 5000 }).should('be.visible');
cy.get('.vs__selected', { timeout: 5000 }).contains('2_milk');
Expand All @@ -103,6 +105,7 @@ describe('Simple browsing', function () {
cy.get('#setting-panel-language').select('fr');
cy.get('.slideout-panel-bg').click();
cy.get('#drop-label-keyboard', { timeout: 10000 }).contains('clavier');
cy.wait(500); // introduce wait, otherwise firefox cypress fails
cy.visit('/', {
onBeforeLoad: (win) => {
Object.defineProperty(win.navigator, 'language', {
Expand Down

0 comments on commit bdb2db2

Please sign in to comment.