Release Notes Channel: Add support for server body ranges (#9631)

This commit is contained in:
yash-signal
2025-01-31 14:52:48 -06:00
committed by GitHub
parent 6b2d65c1e7
commit da7002fc64
6 changed files with 132 additions and 7 deletions

View File

@@ -4,6 +4,7 @@
import createDebug from 'debug';
import { expect } from 'playwright/test';
import { assert } from 'chai';
import type { App } from '../playwright';
import { Bootstrap } from '../bootstrap';
import { MINUTE } from '../../util/durations';
@@ -41,7 +42,7 @@ describe('release notes', function (this: Mocha.Suite) {
await bootstrap.teardown();
});
it('shows release notes with an image', async () => {
it('shows release notes with an image and body ranges', async () => {
const firstWindow = await app.getWindow();
await firstWindow.evaluate('window.SignalCI.resetReleaseNotesFetcher()');
@@ -68,5 +69,68 @@ describe('release notes', function (this: Mocha.Suite) {
await expect(
timelineMessage.locator('img.module-image__image')
).toBeVisible();
const boldCallBodyRange = timelineMessage
.locator('span > strong')
.getByText('Call', { exact: true });
assert.isTrue(
await boldCallBodyRange.isVisible(),
'expected message to have bold text'
);
const italicBodyRange = timelineMessage
.locator('span > em')
.getByText('links', { exact: true });
assert.isTrue(
await italicBodyRange.isVisible(),
'expected message to have italicized text'
);
const strikethroughBodyRange = timelineMessage
.locator('span > s')
.getByText('are', { exact: true });
assert.isTrue(
await strikethroughBodyRange.isVisible(),
'expected message to have strikethrough text'
);
const spoilerBodyRange = timelineMessage
.locator('.MessageTextRenderer__formatting--spoiler')
.getByText('the', { exact: true });
assert.isTrue(
(await spoilerBodyRange.count()) > 0,
'expected message to have spoiler text'
);
const monospaceBodyRange = timelineMessage
.locator('span.MessageTextRenderer__formatting--monospace')
.getByText('missing', { exact: true });
assert.isTrue(
await monospaceBodyRange.isVisible(),
'expected message to have monospace text'
);
const secondTimelineMessage = await getTimelineMessageWithText(
secondWindow,
'Bold text has invalid ranges, italic has valid'
);
await expect(secondTimelineMessage).toBeVisible();
const boldCallBodyRanges = secondTimelineMessage.locator('span > strong');
// 1 for the title
assert.isTrue((await boldCallBodyRanges.count()) === 1);
const italicBodyRanges = secondTimelineMessage.locator('span > em');
assert.isTrue(
(await italicBodyRanges.count()) === 1,
'expected message to have italic text'
);
});
});