Skip to content

Commit

Permalink
feat(cad): Update CAD pages
Browse files Browse the repository at this point in the history
  • Loading branch information
vbudhram committed Sep 25, 2024
1 parent 3da291f commit 83ba127
Show file tree
Hide file tree
Showing 9 changed files with 27 additions and 28 deletions.
16 changes: 8 additions & 8 deletions packages/functional-tests/tests/misc/recoveryKeyPromo.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ test.describe('recovery key promo', () => {
await inlineRecoveryKey.fillOutHint('hint');
await inlineRecoveryKey.clickFinish();

await expect(connectAnotherDevice.header).toBeEnabled();
await expect(connectAnotherDevice.fxaConnected).toBeEnabled();
});

test('can setup recovery key inline after email code', async ({
Expand Down Expand Up @@ -187,8 +187,8 @@ test.describe('recovery key promo', () => {
await inlineRecoveryKey.fillOutHint('hint');
await inlineRecoveryKey.clickFinish();

await page.waitForURL(/connect_another_device/);
await expect(connectAnotherDevice.header).toBeAttached();
await page.waitForURL(/pair/);
await expect(connectAnotherDevice.fxaConnected).toBeEnabled();
});

test('can setup recovery key inline after 2FA', async ({
Expand Down Expand Up @@ -235,8 +235,8 @@ test.describe('recovery key promo', () => {
await inlineRecoveryKey.fillOutHint('hint');
await inlineRecoveryKey.clickFinish();

await page.waitForURL(/connect_another_device/);
await expect(connectAnotherDevice.header).toBeEnabled();
await page.waitForURL(/pair/);
await expect(connectAnotherDevice.fxaConnected).toBeEnabled();

await settings.goto();
await settings.disconnectTotp(); // Required before teardown
Expand Down Expand Up @@ -266,10 +266,10 @@ test.describe('recovery key promo', () => {
await inlineRecoveryKey.clickDoItLater();

// User taken to connect another device page
await page.waitForURL(/connect_another_device/);
await expect(connectAnotherDevice.header).toBeEnabled();
await page.waitForURL(/pair/);
await expect(connectAnotherDevice.fxaConnected).toBeEnabled();

await connectAnotherDevice.startBrowsingButton.click();
await connectAnotherDevice.clickNotNowPair();

await expect(settings.settingsHeading).toBeVisible();
await expect(settings.recoveryKey.status).toHaveText('Not Set');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ test.describe('severity-1 #smoke', () => {
await relier.signInPromptNone();

//Verify error message
await page.waitForURL(/authorization/);
await expect(page.getByText('User is not signed in')).toBeVisible();
});

Expand Down Expand Up @@ -118,7 +119,8 @@ test.describe('severity-1 #smoke', () => {
await page.goto(`${target.relierUrl}/?${query.toString()}`);
await relier.signInPromptNone();

//Verify error message
// Verify error message
await page.waitForURL(/authorization/);
await expect(page.getByText('User is not signed in')).toBeVisible();
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ test.describe('severity-2 #smoke', () => {
await expect(signup.cannotCreateAccountHeading).toBeVisible();
});

test('signup via product page and redirect after confirm', async ({
test('signup via product subscription page and redirect after confirm', async ({
page,
target,
pages: { confirmSignupCode, relier, settings, signup, subscribe },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,13 @@
<div class="card-base">
<header class="relative">
{{#showSuccessMessage}}
<h2 id="fxa-connected-heading" class="w-full text-md font-bold p-3 my-3 rounded bg-green-500 text-gray-900 text-center">{{#t}}Signed in successfully!{{/t}}</h2>
<h2 id="fxa-connected-heading"
class="w-full text-md font-bold p-3 my-3 rounded bg-green-500 text-gray-900 flex items-center justify-center">
<span class="relative mr-2">
<span class="w-6 h-6 rounded-full border-2 border-gray-900 flex items-center justify-center text-gray-900 text-sm font-bold">✓</span>
</span>
{{#t}}Signed in successfully!{{/t}}
</h2>
{{/showSuccessMessage}}

{{#needsMobileConfirmed}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,7 @@ const ConnectAnotherDeviceView = FormView.extend({

// If users are signed in, directly access this page (no query params)
// on desktop, redirect them
if (
this._isSignedIn() &&
window.location.search === '' &&
!this.getUserAgent().isMobile()
) {
if (this._isSignedIn() && !this.getUserAgent().isMobile()) {
this.navigate('/pair');
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,14 +61,14 @@ describe('InlineRecoveryKeySetup', () => {
});
});

it('clicks `do it later` navigates to `connect_another_device`', async () => {
it('clicks `do it later` navigates to `pair`', async () => {
renderWithLocalizationProvider(<Subject />);
await act(async () => {
fireEvent.click(await screen.findByText('Do it later'));
});
expect(ReactUtils.hardNavigate).toHaveBeenCalledWith(
'/connect_another_device',
{},
'/pair',
{ showSuccessMessage: false },
true
);
expect(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export const InlineRecoveryKeySetup = ({
// We do a hard navigate because this page is still in the content server, this
// also keeps all query params so that correct metrics are emitted
// but does not show the signed into FF success message
hardNavigate('/connect_another_device', {}, true);
hardNavigate('/pair', { showSuccessMessage: false }, true);
return <></>;
};

Expand All @@ -52,8 +52,7 @@ export const InlineRecoveryKeySetup = ({
<RecoveryKeySetupHint
{...{ viewName }}
navigateForward={() => {
// Navigate to CAD without success messaging
hardNavigate('/connect_another_device', {}, true);
hardNavigate('/pair', { showSuccessMessage: false }, true);
}}
updateRecoveryKeyHint={updateRecoveryHintHandler}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,11 +83,7 @@ describe('CompleteSignin container', () => {

expect(screen.getByText('Validating sign-in…')).toBeInTheDocument();
await waitFor(() => {
expect(ReactUtils.hardNavigate).toHaveBeenCalledWith(
'/connect_another_device',
{},
true
);
expect(ReactUtils.hardNavigate).toHaveBeenCalledWith('/pair', {}, true);
});
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ const CompleteSigninContainer = (_: RouteComponentProps) => {
// TODO in FXA-9132 - Add metrics event
// Backbone had 'verification.success' and 'signin.success';

hardNavigate('/connect_another_device', {}, true);
hardNavigate('/pair', {}, true);
};

if (validationError) {
Expand Down

0 comments on commit 83ba127

Please sign in to comment.