mirror of
https://github.com/discourse/discourse.git
synced 2024-11-22 14:38:17 +08:00
DEV: Use cloneJSON instead of spread operator (#16615)
Spread does shallow clone, so changes in these tests leak.
This commit is contained in:
parent
79c854d9be
commit
73940fa968
|
@ -8,6 +8,7 @@ import I18n from "I18n";
|
|||
import { test } from "qunit";
|
||||
import { fixturesByUrl } from "discourse/tests/helpers/create-pretender";
|
||||
import sinon from "sinon";
|
||||
import { cloneJSON } from "discourse-common/lib/object";
|
||||
|
||||
acceptance(
|
||||
"Local Dates - Download calendar without default calendar option set",
|
||||
|
@ -15,7 +16,7 @@ acceptance(
|
|||
needs.user({ default_calendar: "none_selected" });
|
||||
needs.settings({ discourse_local_dates_enabled: true });
|
||||
needs.pretender((server, helper) => {
|
||||
const response = { ...fixturesByUrl["/t/281.json"] };
|
||||
const response = cloneJSON(fixturesByUrl["/t/281.json"]);
|
||||
const startDate = moment
|
||||
.tz("Africa/Cairo")
|
||||
.add(1, "days")
|
||||
|
@ -45,7 +46,7 @@ acceptance(
|
|||
needs.user({ default_calendar: "none_selected" });
|
||||
needs.settings({ discourse_local_dates_enabled: true });
|
||||
needs.pretender((server, helper) => {
|
||||
const response = { ...fixturesByUrl["/t/281.json"] };
|
||||
const response = cloneJSON(fixturesByUrl["/t/281.json"]);
|
||||
const startDate = moment
|
||||
.tz("Africa/Cairo")
|
||||
.subtract(1, "days")
|
||||
|
@ -71,7 +72,7 @@ acceptance(
|
|||
needs.user({ default_calendar: "google" });
|
||||
needs.settings({ discourse_local_dates_enabled: true });
|
||||
needs.pretender((server, helper) => {
|
||||
const response = { ...fixturesByUrl["/t/281.json"] };
|
||||
const response = cloneJSON(fixturesByUrl["/t/281.json"]);
|
||||
const startDate = moment
|
||||
.tz("Africa/Cairo")
|
||||
.add(1, "days")
|
||||
|
|
Loading…
Reference in New Issue
Block a user