DEV: Use `cloneJSON` in tests (#195)

This commit is contained in:
Jarek Radosz 2022-03-10 17:34:11 +01:00 committed by GitHub
parent 9ef62060c4
commit 830062a9e6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 1 deletions

View File

@ -2,6 +2,7 @@ import { acceptance, queryAll } from "discourse/tests/helpers/qunit-helpers";
import { fixturesByUrl } from "discourse/tests/helpers/create-pretender";
import { test } from "qunit";
import { click, fillIn, visit } from "@ember/test-helpers";
import { cloneJSON } from "discourse-common/lib/object";
acceptance("Discourse Solved Plugin", function (needs) {
needs.user();
@ -228,7 +229,7 @@ acceptance("Discourse Solved Plugin", function (needs) {
});
server.get("/search", () => {
const fixtures = Object.assign({}, fixturesByUrl["/search.json"]);
const fixtures = cloneJSON(fixturesByUrl["/search.json"]);
fixtures.topics[0].has_accepted_answer = true;
return helper.response(fixtures);
});