diff --git a/frontend/src/__tests__/html.test.ts b/frontend/src/__tests__/html.test.ts index 0810e0c1b..b2479536b 100644 --- a/frontend/src/__tests__/html.test.ts +++ b/frontend/src/__tests__/html.test.ts @@ -654,5 +654,18 @@ describe('HTML Structure', () => { const hint = document.getElementById('account-aws-trust-policy-hint'); expect(hint).not.toBeNull(); }); + + test('aws IAM console deep link opens the role-creation wizard in a new tab (issue #21)', () => { + const link = document.getElementById('account-aws-iam-console-link') as HTMLAnchorElement | null; + expect(link).not.toBeNull(); + expect(link?.tagName.toLowerCase()).toBe('a'); + // Must open in a new tab so operators don't lose the modal + // state they just configured. rel="noopener" is mandatory for + // target="_blank" to avoid reverse-tabnabbing. + expect(link?.getAttribute('target')).toBe('_blank'); + expect(link?.getAttribute('rel') ?? '').toMatch(/noopener/); + // Link target must be the AWS console role-creation wizard. + expect(link?.getAttribute('href')).toBe('https://console.aws.amazon.com/iam/home#/roles$new'); + }); }); }); diff --git a/frontend/src/index.html b/frontend/src/index.html index f01fc9bee..3ac89e98d 100644 --- a/frontend/src/index.html +++ b/frontend/src/index.html @@ -1033,6 +1033,7 @@

AWS Authentication

Attach this policy to the IAM role's trust relationship so CUDly can assume it. The sts:ExternalId condition locks the role to this specific CUDly registration. + Open AWS IAM console →