Makelore 2.0 initial clean snapshot
This commit is contained in:
22
tests/e2e/sidebar-update.spec.ts
Normal file
22
tests/e2e/sidebar-update.spec.ts
Normal file
@@ -0,0 +1,22 @@
|
||||
import { completeSetup, expect, test } from './fixtures/electron';
|
||||
|
||||
test.describe('NianCode sidebar updates', () => {
|
||||
test('shows an available update beside the lower-left account control', async ({ electronApp, page }) => {
|
||||
await completeSetup(page);
|
||||
|
||||
const account = page.getByTestId('sidebar-member-menu-trigger');
|
||||
const update = page.getByTestId('sidebar-update-button');
|
||||
await expect(update).toBeHidden();
|
||||
|
||||
await electronApp.evaluate(({ BrowserWindow }) => {
|
||||
BrowserWindow.getAllWindows()[0]?.webContents.send('update:status-changed', {
|
||||
status: 'available',
|
||||
info: { version: '9.9.9' },
|
||||
});
|
||||
});
|
||||
|
||||
await expect(update).toBeVisible();
|
||||
await expect(update).toHaveAttribute('aria-label', '下载新版本 9.9.9');
|
||||
await expect(account.locator('xpath=..').getByTestId('sidebar-update-button')).toBeVisible();
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user