Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions web/sdk/client/utils/delete-blockers.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,13 @@ describe('instructionLines', () => {
]);
});

it('counts blockers of the same kind', () => {
it('uses the plural when there is more than one invoice', () => {
const lines = instructionLines(
[{ type: 'UNPAID_INVOICE' }, { type: 'UNPAID_INVOICE' }],
wording
);
expect(lines).toEqual([
'Please pay your 2 outstanding invoices before deleting this workspace.'
'Please pay your outstanding invoices before deleting this workspace.'
]);
});

Expand Down
4 changes: 2 additions & 2 deletions web/sdk/client/utils/delete-blockers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ const BLOCKER_INSTRUCTIONS: Record<
} before deleting this ${organizationLabel}.`,
UNPAID_INVOICE: (count, { organizationLabel }) =>
count > 1
? `Please pay your ${count} outstanding invoices before deleting this ${organizationLabel}.`
? `Please pay your outstanding invoices before deleting this ${organizationLabel}.`
: `Please pay your outstanding invoice before deleting this ${organizationLabel}.`,
NEGATIVE_TOKEN_BALANCE: (_, { organizationLabel }) =>
`Please purchase enough tokens to clear your outstanding token balance before deleting this ${organizationLabel}.`
Expand All @@ -32,7 +32,7 @@ const BLOCKER_INSTRUCTIONS: Record<
export const GENERIC_DELETE_BLOCKED_MESSAGE =
'Something is blocking the delete right now. Please try again later or contact support.';

// Returns one sentence per blocker type. Same-type blockers are counted.
// Returns one sentence per blocker type.
export function instructionLines(
blockers: { type: string }[],
wording: BlockerWording = DEFAULT_WORDING
Expand Down
Loading