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:
Robin Ward 2020-10-23 10:22:27 -04:00
parent c0848a5cc4
commit 3b8220cb3b
1 changed files with 2 additions and 4 deletions

View File

@ -3,7 +3,6 @@ import { test } from "qunit";
import { acceptance } from "discourse/tests/helpers/qunit-helpers";
import selectKit from "discourse/tests/helpers/select-kit-helper";
import userFixtures from "discourse/tests/fixtures/user-fixtures";
import { deepMerge } from "discourse-common/lib/object";
acceptance("User's bookmarks", function (needs) {
needs.user();
@ -24,9 +23,8 @@ acceptance("User's bookmarks - reminder", function (needs) {
needs.user();
needs.pretender((server, helper) => {
let listResponse = deepMerge(
{},
userFixtures["/u/eviltrout/bookmarks.json"]
let listResponse = JSON.parse(
JSON.stringify(userFixtures["/u/eviltrout/bookmarks.json"])
);
listResponse.user_bookmark_list.bookmarks[0].reminder_at =
"2028-01-01T08:00";