FIX: State is leaking between tests, causing flakey failures
It seems `deepMerge` sometimes keeps references around. This code performs a true copy and fixes the issue.
This commit is contained in:
parent
c0848a5cc4
commit
3b8220cb3b
|
@ -3,7 +3,6 @@ import { test } from "qunit";
|
||||||
import { acceptance } from "discourse/tests/helpers/qunit-helpers";
|
import { acceptance } from "discourse/tests/helpers/qunit-helpers";
|
||||||
import selectKit from "discourse/tests/helpers/select-kit-helper";
|
import selectKit from "discourse/tests/helpers/select-kit-helper";
|
||||||
import userFixtures from "discourse/tests/fixtures/user-fixtures";
|
import userFixtures from "discourse/tests/fixtures/user-fixtures";
|
||||||
import { deepMerge } from "discourse-common/lib/object";
|
|
||||||
|
|
||||||
acceptance("User's bookmarks", function (needs) {
|
acceptance("User's bookmarks", function (needs) {
|
||||||
needs.user();
|
needs.user();
|
||||||
|
@ -24,9 +23,8 @@ acceptance("User's bookmarks - reminder", function (needs) {
|
||||||
needs.user();
|
needs.user();
|
||||||
|
|
||||||
needs.pretender((server, helper) => {
|
needs.pretender((server, helper) => {
|
||||||
let listResponse = deepMerge(
|
let listResponse = JSON.parse(
|
||||||
{},
|
JSON.stringify(userFixtures["/u/eviltrout/bookmarks.json"])
|
||||||
userFixtures["/u/eviltrout/bookmarks.json"]
|
|
||||||
);
|
);
|
||||||
listResponse.user_bookmark_list.bookmarks[0].reminder_at =
|
listResponse.user_bookmark_list.bookmarks[0].reminder_at =
|
||||||
"2028-01-01T08:00";
|
"2028-01-01T08:00";
|
||||||
|
|
Loading…
Reference in New Issue