Skip to content

Commit 24914e2

Browse files
chore: remove dev flag from notifications (#1117)
1 parent 4daeea4 commit 24914e2

File tree

2 files changed

+1
-63
lines changed

2 files changed

+1
-63
lines changed

app/routes/notifications.js

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,2 @@
11
import Route from '@ember/routing/route';
2-
import { inject as service } from '@ember/service';
3-
export default class NotificationsRoute extends Route {
4-
@service router;
5-
6-
queryParams = {
7-
dev: {
8-
refreshModel: false,
9-
},
10-
};
11-
12-
beforeModel(transition) {
13-
if (transition?.to?.queryParams?.dev !== 'true') {
14-
this.router.transitionTo('/page-not-found');
15-
}
16-
}
17-
}
2+
export default class NotificationsRoute extends Route {}

tests/unit/routes/notifications-test.js

Lines changed: 0 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -9,51 +9,4 @@ module('Unit | Route | notifications', function (hooks) {
99
const route = this.owner.lookup('route:notifications');
1010
assert.ok(route, 'The route exists');
1111
});
12-
13-
test('it should redirect to "/page-not-found" page when dev flag is not present', function (assert) {
14-
assert.expect(3);
15-
16-
const route = this.owner.lookup('route:notifications');
17-
18-
let transitionToCalls = [];
19-
20-
route.router = {
21-
transitionTo(routeName) {
22-
transitionToCalls.push(routeName);
23-
},
24-
};
25-
26-
route.beforeModel({
27-
to: {
28-
queryParams: { dev: 'false' },
29-
},
30-
});
31-
assert.strictEqual(
32-
transitionToCalls[0],
33-
'/page-not-found',
34-
'Redirected to /page-not-found when dev=false',
35-
);
36-
37-
route.beforeModel({
38-
to: {
39-
queryParams: {},
40-
},
41-
});
42-
assert.strictEqual(
43-
transitionToCalls[1],
44-
'/page-not-found',
45-
'Redirected to /page-not-found when dev flag is missing',
46-
);
47-
48-
route.beforeModel({
49-
to: {
50-
queryParams: { dev: 'true' },
51-
},
52-
});
53-
assert.strictEqual(
54-
transitionToCalls.length,
55-
2,
56-
'Did not redirect when dev=true',
57-
);
58-
});
5912
});

0 commit comments

Comments
 (0)