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
6 changes: 2 additions & 4 deletions app/controllers/new-signup.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,9 @@ import apiRequest from '../utils/api-request';
export default class NewSignupController extends Controller {
@service toast;

queryParams = ['currentStep', 'dev', 'signupDev'];
queryParams = ['currentStep', 'dev'];

@tracked dev;
@tracked signupDev;
@tracked isLoading = false;
@tracked isButtonDisabled = true;
@tracked error = '';
Expand All @@ -42,8 +41,7 @@ export default class NewSignupController extends Controller {
};

get isDevMode() {
// replace this signupDev with dev flag once new-signup page is not under dev flag
return this.signupDev === 'true';
return this.dev === 'true';
}

async generateUsername(firstname, lastname) {
Expand Down
8 changes: 0 additions & 8 deletions app/routes/new-signup.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,6 @@ import redirectAuth from '../utils/redirect-auth';
export default class NewSignupRoute extends Route {
@service toast;
@service router;
isDevMode = false;

beforeModel(transition) {
if (transition?.to?.queryParams?.dev !== 'true') {
this.router.transitionTo('/page-not-found');
}
this.isDevMode = true;
}

async model() {
try {
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/controllers/new-signup-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ module('Unit | Controller | new-signup', function (hooks) {
});

test('signup catches error and shows correct error message (dev flag enabled)', async function (assert) {
controller.signupDev = 'true'; // replace signupDev with dev once dev is removed from new-signup
controller.dev = 'true';
controller.signupDetails = {
firstName: fakeUserData.first_name,
lastName: fakeUserData.last_name,
Expand Down
22 changes: 0 additions & 22 deletions tests/unit/routes/new-signup-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,28 +22,6 @@ module('Unit | Route | new-signup', function (hooks) {
this.clock.restore();
});

test('redirects to 404 page if dev flag is not present', function (assert) {
const transition = { to: { queryParams: { dev: 'false' } } };

this.route.beforeModel(transition);

assert.ok(
this.route.router.transitionTo.calledOnceWith('/page-not-found'),
'Redirected to /page-not-found when dev is not true',
);
});

test('allows new-signup page access when dev flag is true', function (assert) {
const transition = { to: { queryParams: { dev: 'true' } } };

this.route.beforeModel(transition);

assert.ok(
this.route.router.transitionTo.notCalled,
'Signup page accessed when dev query param is true',
);
});

test('displays error in case of 401 response', async function (assert) {
this.fetchStub.resolves(new Response(JSON.stringify({}), { status: 401 }));
const result = await this.route.model();
Expand Down