Skip to content

Commit f5ab4d5

Browse files
committed
Address code review
1 parent 0814c38 commit f5ab4d5

3 files changed

Lines changed: 10 additions & 7 deletions

File tree

src/orders/components/OrderDiscountModal/messages.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,12 @@ export const messages = defineMessages({
1616
defaultMessage: "Invalid value",
1717
description: "value input helper text",
1818
},
19-
valueBiggerThatPrice: {
19+
valueBiggerThanPrice: {
2020
defaultMessage: "Cannot be higher than the price",
2121
id: "VIdXPy",
2222
description: "value input helper text",
2323
},
24-
valueBiggerThat100: {
24+
valueBiggerThan100: {
2525
defaultMessage: "Cannot be higher than 100%",
2626
id: "zHx85l",
2727
description: "value input helper text",

src/orders/components/OrderDiscountModal/useDiscountForm.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,8 +114,8 @@ export const useDiscountForm = ({ maxPrice, existingDiscount, isOpen }: UseDisco
114114

115115
if (parsedValue > topAmount) {
116116
return isPercentage
117-
? intl.formatMessage(messages.valueBiggerThat100)
118-
: intl.formatMessage(messages.valueBiggerThatPrice);
117+
? intl.formatMessage(messages.valueBiggerThan100)
118+
: intl.formatMessage(messages.valueBiggerThanPrice);
119119
}
120120

121121
return null;

src/orders/components/OrderLineMetadataDialog/OrderLineMetadataDialog.test.tsx

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -107,9 +107,12 @@ describe("OrderLineMetadataDialog", () => {
107107
);
108108

109109
// Assert
110-
expect(screen.getByText(new RegExp(mockData.quantity.toString()))).toBeInTheDocument();
111-
expect(screen.getByText(new RegExp(mockData.variant.name))).toBeInTheDocument();
112-
expect(screen.getByText(new RegExp(mockData.productSku))).toBeInTheDocument();
110+
expect(
111+
screen.getByText(`${mockData.productName} · ${mockData.variant.name}`),
112+
).toBeInTheDocument();
113+
expect(
114+
screen.getByText(`SKU: ${mockData.productSku} · Qty: ${mockData.quantity}`),
115+
).toBeInTheDocument();
113116
});
114117

115118
it("renders product thumbnail correctly", () => {

0 commit comments

Comments
 (0)