diff --git a/cypress/e2e/basic.spec.ts b/cypress/e2e/basic.spec.ts index 7519eb0..1c85917 100644 --- a/cypress/e2e/basic.spec.ts +++ b/cypress/e2e/basic.spec.ts @@ -39,12 +39,18 @@ context('Basic', () => { it('theme change', () => { const toggle = cy.get('[data-test-id="toggle_theme"]') - toggle.click() + const prefersDark + = window.matchMedia + && window.matchMedia('(prefers-color-scheme: dark)').matches - cy.get('html').should('have.class', 'van-theme-light') + const setting = localStorage.getItem('vueuse-color-scheme') || 'auto' + const isDark = setting === 'dark' || (setting === 'auto' && prefersDark) toggle.click() - cy.get('html').should('have.class', 'van-theme-dark') + if (isDark) + cy.get('html').should('have.class', 'van-theme-light') + else + cy.get('html').should('have.class', 'van-theme-dark') }) }) diff --git a/src/components.d.ts b/src/components.d.ts index 9525f80..0fc4fe7 100644 --- a/src/components.d.ts +++ b/src/components.d.ts @@ -13,8 +13,5 @@ declare module 'vue' { TheCounter: typeof import('./components/TheCounter.vue')['default'] TheFooter: typeof import('./components/TheFooter.vue')['default'] TheInput: typeof import('./components/TheInput.vue')['default'] - VanButton: typeof import('vant/es')['Button'] - VanConfigProvider: typeof import('vant/es')['ConfigProvider'] - VanField: typeof import('vant/es')['Field'] } }