fix kiro aws hash otp page detection

This commit is contained in:
QLHazyCoder
2026-05-22 12:40:37 +08:00
parent ffa6ed7602
commit 442ee5992e
2 changed files with 65 additions and 10 deletions
@@ -315,3 +315,33 @@ test('kiro register content classifies signup verification separately from login
assert.equal(loginDetected.state, 'login_otp_page');
assert.equal(loginDetected.email, 'existing-user@duck.com');
});
test('kiro register content classifies AWS signup hash verify route as register OTP page', () => {
const harness = createHarness({
href: 'https://profile.aws.amazon.com/?workflowID=abc#/signup/verify-otp',
hostname: 'profile.aws.amazon.com',
title: 'Amazon Web Services',
bodyText: 'Verify your email Verification code 6 digits Continue hash-user@duck.com',
});
const detected = harness.detectKiroRegisterPageState();
assert.equal(detected.state, 'register_otp_page');
assert.equal(detected.email, 'hash-user@duck.com');
assert.equal(detected.otpInput, null);
assert.equal(detected.verifyButton, null);
});
test('kiro register content keeps AWS login hash verify route out of register OTP branch', () => {
const harness = createHarness({
href: 'https://profile.aws.amazon.com/?workflowID=abc#/login/verify-otp',
hostname: 'profile.aws.amazon.com',
title: 'Amazon Web Services',
bodyText: 'Verify your identity Verification code 6 digits Continue existing-hash-user@duck.com',
});
const detected = harness.detectKiroRegisterPageState();
assert.equal(detected.state, 'login_otp_page');
assert.equal(detected.email, 'existing-hash-user@duck.com');
});