DEV: Fix test leakage/flakes (#17407)
Fixes failures like: ``` Unhandled request in test environment: /forum/topics/timings (POST) ```
This commit is contained in:
parent
8bf11ae0ce
commit
9365d4e86a
|
@ -1,8 +1,9 @@
|
|||
import { settled } from "@ember/test-helpers";
|
||||
import { discourseModule } from "discourse/tests/helpers/qunit-helpers";
|
||||
import { test } from "qunit";
|
||||
|
||||
discourseModule("Unit | Service | screen-track", function () {
|
||||
test("consolidateTimings", function (assert) {
|
||||
test("consolidateTimings", async function (assert) {
|
||||
const tracker = this.container.lookup("service:screen-track");
|
||||
|
||||
tracker.consolidateTimings({ 1: 10, 2: 5 }, 10, 1);
|
||||
|
@ -19,6 +20,10 @@ discourseModule("Unit | Service | screen-track", function () {
|
|||
);
|
||||
|
||||
tracker.sendNextConsolidatedTiming();
|
||||
|
||||
// Wait for the requests to finish
|
||||
await settled();
|
||||
|
||||
assert.equal(
|
||||
tracker.highestReadFromCache(2),
|
||||
4,
|
||||
|
|
Loading…
Reference in New Issue