Skip to content

Commit 113dbcc

Browse files
committed
test(ui): Assert on specifc credit values
1 parent 2d1ce73 commit 113dbcc

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

packages/ui/src/components/Checkout/__tests__/Checkout.test.tsx

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -404,10 +404,16 @@ describe('Checkout', () => {
404404
expect(getByRole('heading', { name: 'Checkout' })).toBeVisible();
405405
});
406406

407-
expect(getByText('Credit for the remainder of your current subscription.')).toBeVisible();
408-
expect(getByText('Credit from account balance.')).toBeVisible();
409-
expect(getByText('- $5.00')).toBeVisible();
410-
expect(getByText('- $10.00')).toBeVisible();
407+
const prorationCreditRow = getByText('Credit for the remainder of your current subscription.').closest(
408+
'.cl-lineItemsGroup',
409+
);
410+
const accountCreditRow = getByText('Credit from account balance.').closest('.cl-lineItemsGroup');
411+
412+
expect(prorationCreditRow).toBeInTheDocument();
413+
expect(accountCreditRow).toBeInTheDocument();
414+
415+
expect(prorationCreditRow).toHaveTextContent('- $5.00');
416+
expect(accountCreditRow).toHaveTextContent('- $10.00');
411417
});
412418

413419
it('renders free trial details during confirmation stage', async () => {

0 commit comments

Comments
 (0)