mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-07-23 21:38:44 +08:00
feat: disable high power consumption without charger (#14281)
Co-authored-by: DarkSky <darksky2048@gmail.com>
This commit is contained in:
@@ -71,6 +71,14 @@ export const test = baseTest.extend<{
|
||||
await use(page);
|
||||
},
|
||||
context: async ({ context }, use) => {
|
||||
// Force-mark the body so global.css knows we are in a test.
|
||||
// This keeps animations ON (0.1s) for tests, but OFF (0ms) for battery users.
|
||||
await context.addInitScript(() => {
|
||||
window.addEventListener('DOMContentLoaded', () => {
|
||||
document.body.classList.add('playwright-test');
|
||||
});
|
||||
});
|
||||
|
||||
// workaround for skipping onboarding redirect on the web
|
||||
await skipOnboarding(context);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user