Skip to content

Commit f5ad800

Browse files
shakyShaneShane Osbourne
andauthored
ntp: remove bullet from update-notification notes (#1287)
Co-authored-by: Shane Osbourne <[email protected]>
1 parent d220474 commit f5ad800

File tree

3 files changed

+19
-3
lines changed

3 files changed

+19
-3
lines changed

special-pages/pages/new-tab/app/update-notification/components/UpdateNotification.js

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,17 @@ export function WithNotes({ notes, version }) {
5353
<div id={id} class={styles.detailsContent}>
5454
<ul class={styles.list}>
5555
{notes.map((note, index) => {
56-
return <li key={note + index}>{note}</li>;
56+
/**
57+
* Note: Doing this here as a very specific 'view' concern
58+
* Note: using the `if` + `.slice` to avoid regex
59+
* Note: `.slice` is safe on `•` because it is a single Unicode character
60+
* and is represented by a single UTF-16 code unit.
61+
*/
62+
let trimmed = note.trim();
63+
if (trimmed.startsWith('•')) {
64+
trimmed = trimmed.slice(1).trim();
65+
}
66+
return <li key={note + index}>{trimmed}</li>;
5767
})}
5868
</ul>
5969
</div>

special-pages/pages/new-tab/app/update-notification/integration-tests/update-notification.spec.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,9 @@ test.describe('newtab update notifications', () => {
2727

2828
await page.getByText("Browser Updated to version 1.91. See what's new in this release.").waitFor();
2929
await page.getByRole('link', { name: "what's new" }).click();
30-
await page.getByText('Bug fixes and improvements').waitFor();
30+
// this test was updated to add 'exact: true' which would fail if the bullet was not stripped
31+
await page.getByText('Bug fixes and improvements', { exact: true }).waitFor();
32+
await page.getByText('Optimized performance for faster load times', { exact: true }).waitFor();
3133
await page.getByRole('button', { name: 'Dismiss' }).click();
3234
await ntp.mocks.waitForCallCount({ method: 'updateNotification_dismiss', count: 1 });
3335
});

special-pages/pages/new-tab/app/update-notification/mocks/update-notification.data.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,11 @@ export const updateNotificationExamples = {
1010
},
1111
populated: {
1212
content: {
13-
notes: ['Bug fixes and improvements'],
13+
// prettier-ignore
14+
notes: [
15+
'• Bug fixes and improvements',
16+
'Optimized performance for faster load times'
17+
],
1418
version: '1.91',
1519
},
1620
},

0 commit comments

Comments
 (0)