mirror of
https://github.com/signalapp/Signal-Desktop.git
synced 2026-04-27 11:53:23 +01:00
Add mock test for release notes
This commit is contained in:
57
ts/test-mock/release-notes/release_notes_test.ts
Normal file
57
ts/test-mock/release-notes/release_notes_test.ts
Normal file
@@ -0,0 +1,57 @@
|
||||
// Copyright 2025 Signal Messenger, LLC
|
||||
// SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
import createDebug from 'debug';
|
||||
import { assert } from 'chai';
|
||||
|
||||
import type { App } from '../playwright';
|
||||
import { Bootstrap } from '../bootstrap';
|
||||
import { MINUTE } from '../../util/durations';
|
||||
|
||||
import { SIGNAL_ACI } from '../../types/SignalConversation';
|
||||
|
||||
export const debug = createDebug('mock:test:releaseNotes');
|
||||
|
||||
describe('release notes', function (this: Mocha.Suite) {
|
||||
let bootstrap: Bootstrap;
|
||||
let app: App;
|
||||
let nextApp: App;
|
||||
|
||||
this.timeout(MINUTE);
|
||||
beforeEach(async () => {
|
||||
bootstrap = new Bootstrap();
|
||||
await bootstrap.init();
|
||||
|
||||
app = await bootstrap.link();
|
||||
});
|
||||
|
||||
afterEach(async function (this: Mocha.Context) {
|
||||
if (!bootstrap) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (nextApp) {
|
||||
await bootstrap.maybeSaveLogs(this.currentTest, nextApp);
|
||||
}
|
||||
await nextApp?.close();
|
||||
await bootstrap.teardown();
|
||||
});
|
||||
|
||||
it('shows release notes', async () => {
|
||||
const firstWindow = await app.getWindow();
|
||||
|
||||
await firstWindow.evaluate('window.SignalCI.resetReleaseNotesFetcher()');
|
||||
|
||||
await app.close();
|
||||
|
||||
nextApp = await bootstrap.startApp();
|
||||
|
||||
const secondWindow = await nextApp.getWindow();
|
||||
|
||||
const leftPane = secondWindow.locator('#LeftPane');
|
||||
const releaseNoteConversation = leftPane.getByTestId(SIGNAL_ACI);
|
||||
await releaseNoteConversation.waitFor();
|
||||
|
||||
assert.isTrue(await releaseNoteConversation.isVisible());
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user