Skip to content

Commit

Permalink
tests: added assertion that payment button is present
Browse files Browse the repository at this point in the history
  • Loading branch information
mwargan committed Apr 24, 2024
1 parent bad91eb commit 7838826
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/stories/Forms/AddPaymentMethod.stories.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,13 @@ export const Default: Story = {
play: async ({ canvasElement }: any) => {
const canvas = within(canvasElement);

// Confirm the submit button is there
await waitFor(() => {
expect(canvas.getByRole("button")).toBeVisible();
// It should be disabled
expect(canvas.getByRole("button")).toBeDisabled();
});

// We can assert that the iframe is visible "data-cy="add-payment-form""
waitFor(
() => {
Expand Down

0 comments on commit 7838826

Please sign in to comment.