Skip to content

Commit

Permalink
Add tests for when actions are not allowed
Browse files Browse the repository at this point in the history
  • Loading branch information
Jinksi committed Sep 19, 2023
1 parent 939c40d commit d8ca8e6
Showing 1 changed file with 48 additions and 0 deletions.
48 changes: 48 additions & 0 deletions client/payment-details/summary/test/index.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -505,6 +505,18 @@ describe( 'PaymentDetailsSummary', () => {
ignore: '.a11y-speak-region',
} );
screen.getByRole( 'button', { name: /View dispute details/i } );

// No actions rendered
expect(
screen.queryByRole( 'button', {
name: /Challenge/i,
} )
).toBeNull();
expect(
screen.queryByRole( 'button', {
name: /Accept/i,
} )
).toBeNull();
} );

test( 'correctly renders dispute details for "under_review" disputes', () => {
Expand All @@ -520,6 +532,18 @@ describe( 'PaymentDetailsSummary', () => {
ignore: '.a11y-speak-region',
} );
screen.getByRole( 'button', { name: /View submitted evidence/i } );

// No actions rendered
expect(
screen.queryByRole( 'button', {
name: /Challenge/i,
} )
).toBeNull();
expect(
screen.queryByRole( 'button', {
name: /Accept/i,
} )
).toBeNull();
} );

test( 'correctly renders dispute details for "accepted" disputes', () => {
Expand All @@ -539,6 +563,18 @@ describe( 'PaymentDetailsSummary', () => {
screen.getByText( /\$15.00 fee/i, {
ignore: '.a11y-speak-region',
} );

// No actions rendered
expect(
screen.queryByRole( 'button', {
name: /Challenge/i,
} )
).toBeNull();
expect(
screen.queryByRole( 'button', {
name: /Accept/i,
} )
).toBeNull();
} );

test( 'correctly renders dispute details for "lost" disputes', () => {
Expand All @@ -559,6 +595,18 @@ describe( 'PaymentDetailsSummary', () => {
ignore: '.a11y-speak-region',
} );
screen.getByRole( 'button', { name: /View dispute details/i } );

// No actions rendered
expect(
screen.queryByRole( 'button', {
name: /Challenge/i,
} )
).toBeNull();
expect(
screen.queryByRole( 'button', {
name: /Accept/i,
} )
).toBeNull();
} );
} );
} );

0 comments on commit d8ca8e6

Please sign in to comment.