Skip to content

Commit

Permalink
Add tests for dispute refund menu cases
Browse files Browse the repository at this point in the history
  • Loading branch information
Jinksi committed Jan 3, 2024
1 parent b864c62 commit 1c98634
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 @@ -427,6 +427,13 @@ describe( 'PaymentDetailsSummary', () => {
screen.getByRole( 'button', {
name: /Accept dispute/,
} );

// Refund menu is not rendered
expect(
screen.queryByRole( 'button', {
name: /Translation actions/i,
} )
).toBeNull();
} );

test( 'renders the information of a disputed charge when the store/charge currency differ', () => {
Expand Down Expand Up @@ -684,6 +691,11 @@ describe( 'PaymentDetailsSummary', () => {
name: /Accept/i,
} )
).toBeNull();

// Refund menu is rendered
screen.getByRole( 'button', {
name: /Translation actions/i,
} );
} );

test( 'correctly renders dispute details for "under_review" disputes', () => {
Expand Down Expand Up @@ -712,6 +724,13 @@ describe( 'PaymentDetailsSummary', () => {
name: /Accept/i,
} )
).toBeNull();

// Refund menu is not rendered
expect(
screen.queryByRole( 'button', {
name: /Translation actions/i,
} )
).toBeNull();
} );

test( 'correctly renders dispute details for "accepted" disputes', () => {
Expand Down Expand Up @@ -744,6 +763,13 @@ describe( 'PaymentDetailsSummary', () => {
name: /Accept/i,
} )
).toBeNull();

// Refund menu is not rendered
expect(
screen.queryByRole( 'button', {
name: /Translation actions/i,
} )
).toBeNull();
} );

test( 'correctly renders dispute details for "lost" disputes', () => {
Expand Down Expand Up @@ -777,6 +803,13 @@ describe( 'PaymentDetailsSummary', () => {
name: /Accept/i,
} )
).toBeNull();

// Refund menu is not rendered
expect(
screen.queryByRole( 'button', {
name: /Translation actions/i,
} )
).toBeNull();
} );

test( 'correctly renders dispute details for "warning_needs_response" inquiry disputes', () => {
Expand Down Expand Up @@ -807,6 +840,11 @@ describe( 'PaymentDetailsSummary', () => {
screen.getByRole( 'button', {
name: /Issue refund/i,
} );

// Refund menu is rendered
screen.getByRole( 'button', {
name: /Translation actions/i,
} );
} );

test( 'correctly renders dispute details for "warning_under_review" inquiry disputes', () => {
Expand Down Expand Up @@ -834,6 +872,11 @@ describe( 'PaymentDetailsSummary', () => {
name: /Accept/i,
} )
).toBeNull();

// Refund menu is rendered
screen.getByRole( 'button', {
name: /Translation actions/i,
} );
} );

test( 'correctly renders dispute details for "warning_closed" inquiry disputes', () => {
Expand Down Expand Up @@ -862,6 +905,11 @@ describe( 'PaymentDetailsSummary', () => {
name: /Accept/i,
} )
).toBeNull();

// Refund menu is rendered
screen.getByRole( 'button', {
name: /Translation actions/i,
} );
} );

describe( 'order missing notice', () => {
Expand Down

0 comments on commit 1c98634

Please sign in to comment.