Skip to content

Commit 992e7b9

Browse files
chore: remove feature flag from mobile page (#1019)
* chore: remove feature flag from mobile page * fix: naming for mobile route test
1 parent a5d4bac commit 992e7b9

File tree

2 files changed

+4
-28
lines changed

2 files changed

+4
-28
lines changed

app/routes/mobile.js

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,6 @@ export default class MobileRoute extends Route {
99
@service toast;
1010
@service router;
1111

12-
beforeModel(transition) {
13-
if (transition?.to?.queryParams?.dev !== 'true') {
14-
this.router.transitionTo('/page-not-found');
15-
}
16-
}
17-
1812
async model() {
1913
try {
2014
const response = await fetch(SELF_USER_PROFILE_URL, {

tests/unit/routes/mobile-test.js

Lines changed: 4 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -10,34 +10,16 @@ module('Unit | Route | mobile', function (hooks) {
1010
hooks.beforeEach(function () {
1111
this.fetchStub = sinon.stub(window, 'fetch');
1212
this.route = this.owner.lookup('route:mobile');
13-
sinon.stub(this.route.router, 'transitionTo');
1413
});
1514

1615
hooks.afterEach(function () {
1716
this.fetchStub.restore();
18-
sinon.restore();
1917
});
2018

21-
test('redirects to 404 page if dev flag is not present', function (assert) {
22-
const transition = { to: { queryParams: { dev: 'false' } } };
23-
24-
this.route.beforeModel(transition);
25-
26-
assert.ok(
27-
this.route.router.transitionTo.calledOnceWith('/page-not-found'),
28-
'Redirected to /page-not-found when dev is not true',
29-
);
30-
});
31-
32-
test('allows access when dev flag is true', function (assert) {
33-
const transition = { to: { queryParams: { dev: 'true' } } };
34-
35-
this.route.beforeModel(transition);
36-
37-
assert.ok(
38-
this.route.router.transitionTo.notCalled,
39-
'No redirection occurs when dev query param is true',
40-
);
19+
test('mobile route exists and is accessible', function (assert) {
20+
assert.expect(1);
21+
const route = this.owner.lookup('route:mobile');
22+
assert.ok(route, 'The mobile route exists');
4123
});
4224

4325
test('it fetches user profile and returns userId if API responds with 200', async function (assert) {

0 commit comments

Comments
 (0)