Skip to content

Commit e9a6695

Browse files
simplified, and extended, max duration check
1 parent a5bc073 commit e9a6695

File tree

1 file changed

+15
-16
lines changed

1 file changed

+15
-16
lines changed

packages/frontend/tests/acceptance/route-performance-test.js

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,7 @@ module('Acceptance | performance', function (hooks) {
88
setupApplicationTest(hooks);
99

1010
hooks.beforeEach(async function () {
11-
this.set('durationQuick', 1000);
12-
this.set('durationModerate', 2000);
11+
this.set('maxDuration', 5000);
1312

1413
this.school = this.server.create('school');
1514
this.user = await setupAuthentication({ school: this.school }, true);
@@ -48,7 +47,7 @@ module('Acceptance | performance', function (hooks) {
4847

4948
assert.strictEqual(currentRouteName(), 'dashboard.week', 'current route name is correct');
5049
assert.ok(
51-
duration < this.durationQuick,
50+
duration < this.maxDuration,
5251
`Render time was ${duration}ms`,
5352
`route loaded in allowable time: ${duration}`,
5453
);
@@ -66,7 +65,7 @@ module('Acceptance | performance', function (hooks) {
6665

6766
assert.strictEqual(currentRouteName(), 'dashboard.materials', 'current route name is correct');
6867
assert.ok(
69-
duration < this.durationQuick,
68+
duration < this.maxDuration,
7069
`Render time was ${duration}ms`,
7170
`route loaded in allowable time: ${duration}`,
7271
);
@@ -82,7 +81,7 @@ module('Acceptance | performance', function (hooks) {
8281

8382
assert.strictEqual(currentRouteName(), 'dashboard.calendar', 'current route name is correct');
8483
assert.ok(
85-
duration < this.durationQuick,
84+
duration < this.maxDuration,
8685
`Render time was ${duration}ms`,
8786
`route loaded in allowable time: ${duration}`,
8887
);
@@ -98,7 +97,7 @@ module('Acceptance | performance', function (hooks) {
9897

9998
assert.strictEqual(currentRouteName(), 'weeklyevents', 'current route name is correct');
10099
assert.ok(
101-
duration < this.durationQuick,
100+
duration < this.maxDuration,
102101
`Render time was ${duration}ms`,
103102
`route loaded in allowable time: ${duration}`,
104103
);
@@ -125,7 +124,7 @@ module('Acceptance | performance', function (hooks) {
125124

126125
assert.strictEqual(currentRouteName(), 'courses', 'current route name is correct');
127126
assert.ok(
128-
duration < this.durationModerate,
127+
duration < this.maxDuration,
129128
`Render time was ${duration}ms`,
130129
`route loaded in allowable: ${duration}`,
131130
);
@@ -158,7 +157,7 @@ module('Acceptance | performance', function (hooks) {
158157

159158
assert.strictEqual(currentRouteName(), 'course.index', 'current route name is correct');
160159
assert.ok(
161-
duration < this.durationModerate,
160+
duration < this.maxDuration,
162161
`Render time was ${duration}ms`,
163162
`route loaded in allowable: ${duration}`,
164163
);
@@ -186,7 +185,7 @@ module('Acceptance | performance', function (hooks) {
186185

187186
assert.strictEqual(currentRouteName(), 'learner-groups', 'current route name is correct');
188187
assert.ok(
189-
duration < this.durationQuick,
188+
duration < this.maxDuration,
190189
`Render time was ${duration}ms`,
191190
`route loaded in allowable time: ${duration}`,
192191
);
@@ -211,7 +210,7 @@ module('Acceptance | performance', function (hooks) {
211210

212211
assert.strictEqual(currentRouteName(), 'instructor-groups', 'current route is correct');
213212
assert.ok(
214-
duration < this.durationQuick,
213+
duration < this.maxDuration,
215214
`Render time was ${duration}ms`,
216215
`route loaded in allowable time: ${duration}`,
217216
);
@@ -231,7 +230,7 @@ module('Acceptance | performance', function (hooks) {
231230

232231
assert.strictEqual(currentRouteName(), 'schools', 'current route name is correct');
233232
assert.ok(
234-
duration < this.durationQuick,
233+
duration < this.maxDuration,
235234
`Render time was ${duration}ms`,
236235
`route loaded in allowable time: ${duration}`,
237236
);
@@ -251,7 +250,7 @@ module('Acceptance | performance', function (hooks) {
251250

252251
assert.strictEqual(currentRouteName(), 'programs', 'current route name is correct');
253252
assert.ok(
254-
duration < this.durationQuick,
253+
duration < this.maxDuration,
255254
`Render time was ${duration}ms`,
256255
`route loaded in allowable time: ${duration}`,
257256
);
@@ -304,7 +303,7 @@ module('Acceptance | performance', function (hooks) {
304303

305304
assert.strictEqual(currentRouteName(), 'reports.subjects', 'current route name is correct');
306305
assert.ok(
307-
duration < this.durationQuick,
306+
duration < this.maxDuration,
308307
`Render time was ${duration}ms`,
309308
`route loaded in allowable time: ${duration}`,
310309
);
@@ -320,7 +319,7 @@ module('Acceptance | performance', function (hooks) {
320319

321320
assert.strictEqual(currentRouteName(), 'admin-dashboard', 'current route name is correct');
322321
assert.ok(
323-
duration < this.durationQuick,
322+
duration < this.maxDuration,
324323
`Render time was ${duration}ms`,
325324
`route loaded in allowable time: ${duration}`,
326325
);
@@ -338,7 +337,7 @@ module('Acceptance | performance', function (hooks) {
338337

339338
assert.strictEqual(currentRouteName(), 'users', 'current route name is correct');
340339
assert.ok(
341-
duration < this.durationQuick,
340+
duration < this.maxDuration,
342341
`Render time was ${duration}ms`,
343342
`route loaded in allowable time: ${duration}`,
344343
);
@@ -366,7 +365,7 @@ module('Acceptance | performance', function (hooks) {
366365
'current route name is correct',
367366
);
368367
assert.ok(
369-
duration < this.durationQuick,
368+
duration < this.maxDuration,
370369
`Render time was ${duration}ms`,
371370
`route loaded in allowable time: ${duration}`,
372371
);

0 commit comments

Comments
 (0)