Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ntp: remove bullet from update-notification notes #1287

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,17 @@ export function WithNotes({ notes, version }) {
<div id={id} class={styles.detailsContent}>
<ul class={styles.list}>
{notes.map((note, index) => {
return <li key={note + index}>{note}</li>;
/**
* Note: Doing this here as a very specific 'view' concern
* Note: using the `if` + `.slice` to avoid regex
* Note: `.slice` is safe on `•` because it is a single Unicode character
* and is represented by a single UTF-16 code unit.
*/
let trimmed = note.trim();
if (trimmed.startsWith('•')) {
trimmed = trimmed.slice(1).trim();
}
return <li key={note + index}>{trimmed}</li>;
})}
</ul>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@ test.describe('newtab update notifications', () => {

await page.getByText("Browser Updated to version 1.91. See what's new in this release.").waitFor();
await page.getByRole('link', { name: "what's new" }).click();
await page.getByText('Bug fixes and improvements').waitFor();
// this test was updated to add 'exact: true' which would fail if the bullet was not stripped
await page.getByText('Bug fixes and improvements', { exact: true }).waitFor();
await page.getByText('Optimized performance for faster load times', { exact: true }).waitFor();
await page.getByRole('button', { name: 'Dismiss' }).click();
await ntp.mocks.waitForCallCount({ method: 'updateNotification_dismiss', count: 1 });
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,11 @@ export const updateNotificationExamples = {
},
populated: {
content: {
notes: ['Bug fixes and improvements'],
// prettier-ignore
notes: [
'• Bug fixes and improvements',
'Optimized performance for faster load times'
],
version: '1.91',
},
},
Expand Down
Loading