Skip to content
Open
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
10 changes: 5 additions & 5 deletions frontend/src/__tests__/settings-accounts.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1237,28 +1237,28 @@ describe('Account overrides modal', () => {

test('Overrides button opens an account-scoped modal whose title binds to the account', async () => {
(api.listAccounts as jest.Mock).mockResolvedValue([
{ id: 'acc-1', name: 'AWS Prod', provider: 'aws', external_id: '540659244915', enabled: true },
{ id: 'acc-1', name: 'AWS Prod', provider: 'aws', external_id: '123456789012', enabled: true },
]);
(api.listAccountServiceOverrides as jest.Mock).mockResolvedValue([
{ id: 'o1', account_id: 'acc-1', provider: 'aws', service: 'ec2', payment: 'all-upfront' },
]);

await loadAccountsForProvider('aws');
const btn = document.querySelector(
`button[aria-label="Service overrides for AWS Prod (540659244915)"]`,
`button[aria-label="Service overrides for AWS Prod (123456789012)"]`,
) as HTMLButtonElement;
btn.click();
await new Promise(r => setTimeout(r, 0));

const modal = document.getElementById('account-overrides-modal') as HTMLElement;
expect(modal.classList.contains('hidden')).toBe(false);
const title = document.getElementById('account-overrides-modal-title') as HTMLElement;
expect(title.textContent).toBe('Service overrides for AWS Prod (540659244915)');
expect(title.textContent).toBe('Service overrides for AWS Prod (123456789012)');
});

test('switching accounts swaps the modal title; only one account context is active at a time', async () => {
(api.listAccounts as jest.Mock).mockResolvedValue([
{ id: 'acc-a', name: 'AWS Prod', provider: 'aws', external_id: '540659244915', enabled: true },
{ id: 'acc-a', name: 'AWS Prod', provider: 'aws', external_id: '123456789012', enabled: true },
{ id: 'acc-b', name: 'CUDly host', provider: 'aws', external_id: '909626172446', enabled: true },
]);
(api.listAccountServiceOverrides as jest.Mock).mockResolvedValue([]);
Expand All @@ -1268,7 +1268,7 @@ describe('Account overrides modal', () => {

// Click Overrides on Account A.
(document.querySelector(
`button[aria-label="Service overrides for AWS Prod (540659244915)"]`,
`button[aria-label="Service overrides for AWS Prod (123456789012)"]`,
) as HTMLButtonElement).click();
await new Promise(r => setTimeout(r, 0));
expect(titleEl.textContent).toContain('AWS Prod');
Expand Down
2 changes: 1 addition & 1 deletion internal/email/sender.go
Original file line number Diff line number Diff line change
Expand Up @@ -504,7 +504,7 @@ type RecommendationSummary struct {
// "$0" so a no-upfront payment option visibly shows that fact.
UpfrontCost float64
// AccountLabel is a friendly per-rec account identifier (e.g.
// "AWS 540659244915 (acme-prod)"). Empty omits the line.
// "AWS 123456789012 (acme-prod)"). Empty omits the line.
AccountLabel string
}

Expand Down
6 changes: 3 additions & 3 deletions internal/email/template_renderers_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ func TestRenderPurchaseApprovalRequestEmail_NewContextFields_Issue287(t *testing
Recommendations: []RecommendationSummary{{
Service: "ec2", ResourceType: "m5.large", Region: "us-east-1",
Count: 8, Term: 3, Payment: "all-upfront", UpfrontCost: 1234.56,
MonthlySavings: 58.0, AccountLabel: "AWS 540659244915",
MonthlySavings: 58.0, AccountLabel: "AWS 123456789012",
}},
}

Expand All @@ -280,7 +280,7 @@ func TestRenderPurchaseApprovalRequestEmail_NewContextFields_Issue287(t *testing
assert.Contains(t, body, "Term: 3yr")
assert.Contains(t, body, "Payment: all-upfront")
assert.Contains(t, body, "Upfront: $1234.56")
assert.Contains(t, body, "Account: AWS 540659244915")
assert.Contains(t, body, "Account: AWS 123456789012")

// Requested-by header.
assert.Contains(t, body, "Cristi M")
Expand Down Expand Up @@ -318,7 +318,7 @@ func TestRenderPurchaseApprovalRequestEmailHTML_Issue287(t *testing.T) {
Recommendations: []RecommendationSummary{{
Service: "ec2", ResourceType: "m5.large", Region: "us-east-1",
Count: 8, Term: 3, Payment: "all-upfront", UpfrontCost: 1234.56,
MonthlySavings: 58.0, AccountLabel: "AWS 540659244915",
MonthlySavings: 58.0, AccountLabel: "AWS 123456789012",
}},
}

Expand Down
2 changes: 1 addition & 1 deletion known_issues/23_ux_review_2026_04_22.md
Original file line number Diff line number Diff line change
Expand Up @@ -507,7 +507,7 @@

#### MEDIUM: Per-provider Accounts sections render as inline text rows — need a table

**Evidence:** `AWS personal (540659244915) Edit Test Credentials Overrides Delete` is a single text-flow line. Hard to scan.
**Evidence:** `AWS personal (123456789012) Edit Test Credentials Overrides Delete` is a single text-flow line. Hard to scan.

**Recommended fix:** Convert to a table: `Name | ID | Status | Actions`.

Expand Down
Loading