From 3b8220cb3bf3d33537462392439e85c71fe1ab04 Mon Sep 17 00:00:00 2001 From: Robin Ward Date: Fri, 23 Oct 2020 10:22:27 -0400 Subject: [PATCH] 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. --- .../discourse/tests/acceptance/user-bookmarks-test.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/app/assets/javascripts/discourse/tests/acceptance/user-bookmarks-test.js b/app/assets/javascripts/discourse/tests/acceptance/user-bookmarks-test.js index fb3611bc750..8874efd73d0 100644 --- a/app/assets/javascripts/discourse/tests/acceptance/user-bookmarks-test.js +++ b/app/assets/javascripts/discourse/tests/acceptance/user-bookmarks-test.js @@ -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";