Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Test]: flakey test with save #5616

Merged
merged 1 commit into from
Sep 30, 2020
Merged
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
3 changes: 2 additions & 1 deletion tests/integration/components/user-profile-ics-test.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { module, test } from 'qunit';
import { setupRenderingTest } from 'ember-qunit';
import { render, click } from '@ember/test-helpers';
import { render, click, settled } from '@ember/test-helpers';
import hbs from 'htmlbars-inline-precompile';
import {
triggerSuccess
Expand Down Expand Up @@ -43,6 +43,7 @@ module('Integration | Component | user profile ics', function(hooks) {

await render(hbs`<UserProfileIcs @isManaging={{true}} @user={{this.user}} @setIsManaging={{noop}} />`);
await click('.refresh-key');
await settled();
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm guessing our test harness awaits this chain of async operations. But we must be missing something 🤔

  @dropTask
  *refreshKey() {
    const token = yield this.randomToken(this.args.user.id);
    this.args.user.set('icsFeedKey', token);
    yield this.args.user.save();
    this.args.setIsManaging(false);
    this.hasSavedRecently = true;
    yield timeout(500);
    this.hasSavedRecently = false;
  }

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IIRC I pulled this settled() out a week or so ago since it didn't seem to be needed anymore and tests ran, but I'm not fussed about it being back. Thanks!


const icsFeedKey = this.server.db.users.find(13).icsFeedKey;
assert.notEqual(icsFeedKey, 'testkey', 'icsFeedKey is not the same');
Expand Down