Add test for commands button text
This commit is contained in:
@ -6,7 +6,39 @@ test.afterEach(async ({ page }, testInfo) => {
|
|||||||
await tearDown(page, testInfo)
|
await tearDown(page, testInfo)
|
||||||
})
|
})
|
||||||
|
|
||||||
test.describe('Electron user sidebar menu tests', () => {
|
test.describe('Electron app header tests', () => {
|
||||||
|
test(
|
||||||
|
'Open Command Palette button has correct shortcut',
|
||||||
|
{ tag: '@electron' },
|
||||||
|
async ({ browserName }, testInfo) => {
|
||||||
|
const { electronApp, page } = await setupElectron({
|
||||||
|
testInfo,
|
||||||
|
folderSetupFn: async () => {},
|
||||||
|
})
|
||||||
|
|
||||||
|
await page.setViewportSize({ width: 1200, height: 500 })
|
||||||
|
|
||||||
|
// No space before the shortcut since it checks textContent.
|
||||||
|
let text
|
||||||
|
switch (process.platform) {
|
||||||
|
case 'darwin':
|
||||||
|
text = 'Commands⌘ K'
|
||||||
|
break
|
||||||
|
case 'win32':
|
||||||
|
text = 'CommandsCtrl + K'
|
||||||
|
break
|
||||||
|
default: // 'linux' etc.
|
||||||
|
text = 'CommandsCtrl K'
|
||||||
|
break
|
||||||
|
}
|
||||||
|
const commandsButton = page.getByRole('button', { name: 'Commands' })
|
||||||
|
await expect(commandsButton).toBeVisible()
|
||||||
|
await expect(commandsButton).toHaveText(text)
|
||||||
|
|
||||||
|
await electronApp.close()
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
test(
|
test(
|
||||||
'User settings has correct shortcut',
|
'User settings has correct shortcut',
|
||||||
{ tag: '@electron' },
|
{ tag: '@electron' },
|
||||||
|
Reference in New Issue
Block a user