Skip to content

Commit

Permalink
Auto merge of #2775 - Turbo87:progress, r=locks
Browse files Browse the repository at this point in the history
services/progress: Remove progress bar when running tests

Waiting for the progressbar to finish animating was slowing down the tests unnecessarily, so instead of waiting for it to finish animating we won't show it anymore at all.

r? `@locks`
  • Loading branch information
bors committed Sep 11, 2020
2 parents ed1d719 + f47c0cf commit d69938a
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions app/services/progress.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
import Service, { inject as service } from '@ember/service';
import { htmlSafe } from '@ember/string';
import { tracked } from '@glimmer/tracking';
import Ember from 'ember';

import { rawTimeout, task } from 'ember-concurrency';
import { buildWaiter } from 'ember-test-waiters';

const SPEED = 200;

let waiter = buildWaiter('progress-bar');

export default class ProgressService extends Service {
@service router;

Expand All @@ -29,7 +27,7 @@ export default class ProgressService extends Service {
counterTask;

@(task(function* () {
let token = waiter.beginAsync();
if (Ember.testing) return;

let progress = 0;
this._style = `width: 0%`;
Expand Down Expand Up @@ -61,8 +59,6 @@ export default class ProgressService extends Service {
this._style = `transition: width ${SPEED}ms linear; width: 100%`;
yield rawTimeout(SPEED);
this._style = `transition: opacity ${SPEED * 2}ms linear; width: 100%; opacity: 0`;

waiter.endAsync(token);
}).drop())
updateTask;
}

0 comments on commit d69938a

Please sign in to comment.