-
-
Notifications
You must be signed in to change notification settings - Fork 5.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'dev' into pr/wysiwyg-highlight-searches
- Loading branch information
Showing
56 changed files
with
321 additions
and
103 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,4 +6,9 @@ | |
font-style: italic; | ||
max-width: 70em; | ||
margin-top: 5px; | ||
|
||
&.-empty { | ||
margin: 0; | ||
padding: 0; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
|
||
.note-editor-wrapper { | ||
flex-grow: 1; | ||
height: 100%; | ||
width: 100%; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import { ElectronApplication } from '@playwright/test'; | ||
|
||
const setDarkMode = (app: ElectronApplication, darkMode: boolean) => { | ||
return app.evaluate(({ nativeTheme }, darkMode) => { | ||
nativeTheme.themeSource = darkMode ? 'dark' : 'light'; | ||
}, darkMode); | ||
}; | ||
|
||
export default setDarkMode; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
import { test, expect } from './util/test'; | ||
import MainScreen from './models/MainScreen'; | ||
import SettingsScreen from './models/SettingsScreen'; | ||
import AxeBuilder from '@axe-core/playwright'; | ||
import { Page } from '@playwright/test'; | ||
|
||
const createScanner = (page: Page) => { | ||
return new AxeBuilder({ page }) | ||
.disableRules(['page-has-heading-one']) | ||
.setLegacyMode(true); | ||
}; | ||
|
||
// Fade-in transitions can cause color contrast issues if still running | ||
// during a scan. | ||
// See https://github.com/dequelabs/axe-core-npm/issues/952 | ||
const waitForAnimationsToEnd = (page: Page) => { | ||
return page.locator('body').evaluate(element => { | ||
const animationPromises = element | ||
.getAnimations({ subtree: true }) | ||
.map(animation => animation.finished); | ||
return Promise.all(animationPromises); | ||
}); | ||
}; | ||
|
||
const expectNoViolations = async (page: Page) => { | ||
await waitForAnimationsToEnd(page); | ||
const results = await createScanner(page).analyze(); | ||
expect(results.violations).toEqual([]); | ||
}; | ||
|
||
|
||
test.describe('wcag', () => { | ||
for (const tabName of ['General', 'Plugins']) { | ||
test(`should not detect significant issues in the settings screen ${tabName} tab`, async ({ electronApp, mainWindow }) => { | ||
const mainScreen = new MainScreen(mainWindow); | ||
await mainScreen.waitFor(); | ||
|
||
await mainScreen.openSettings(electronApp); | ||
|
||
// Should be on the settings screen | ||
const settingsScreen = new SettingsScreen(mainWindow); | ||
await settingsScreen.waitFor(); | ||
|
||
const tabLocator = settingsScreen.getTabLocator(tabName); | ||
await tabLocator.click(); | ||
await expect(tabLocator).toBeFocused(); | ||
|
||
await expectNoViolations(mainWindow); | ||
}); | ||
} | ||
|
||
test('should not detect significant issues in the main screen with an open note', async ({ mainWindow }) => { | ||
const mainScreen = new MainScreen(mainWindow); | ||
await mainScreen.waitFor(); | ||
|
||
await mainScreen.createNewNote('Test'); | ||
|
||
// For now, activate all notes to make it active. When inactive, it causes a contrast warning. | ||
// This seems to be allowed under WCAG 2.2 SC 1.4.3 under the "Incidental" exception. | ||
await mainScreen.sidebar.allNotes.click(); | ||
|
||
// Ensure that `:hover` styling is consistent between tests: | ||
await mainScreen.noteEditor.noteTitleInput.hover(); | ||
|
||
await expectNoViolations(mainWindow); | ||
}); | ||
}); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.