Skip to content

Commit 306c1df

Browse files
fix accessible product label double spacing
1 parent f6b079e commit 306c1df

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

dotcom-rendering/src/components/Button/productUtils.test.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ describe('createAccessibleProductLabel', () => {
3131

3232
it('describes the old and new prices accessibly', () => {
3333
expect(createAccessibleProductLabel('~£10~ £5 at Shop')).toBe(
34-
'Was £10, now £5 at Shop',
34+
'Was £10, now £5 at Shop',
3535
);
3636
});
3737
});

dotcom-rendering/src/components/Button/productUtils.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ export const createAccessibleProductLabel = (label: string): string => {
5252
if (isUndefined(parsedLabel)) {
5353
return label;
5454
} else {
55-
return `Was ${parsedLabel.struckThrough}, now ${parsedLabel.restOfLabel}`;
55+
return `Was ${parsedLabel.struckThrough}, now ${parsedLabel.restOfLabel.trimStart()}`;
5656
}
5757
};
5858

0 commit comments

Comments
 (0)