DEV: Avoid cloning site settings in QUnit tests (#18811)
`siteSettings` is now a service which means there should only be one state for `siteSettings` during the life time of the application. This also helps to maintain parity with production where the `site` model relies on the `siteSettings` service and not a clone of the attributes.
This commit is contained in:
parent
e6856a3ca3
commit
46e9f402eb
|
@ -127,11 +127,10 @@ export function withFrozenTime(timeString, timezone, callback) {
|
|||
|
||||
let _pretenderCallbacks = {};
|
||||
|
||||
export function resetSite(siteSettings, extras = {}) {
|
||||
export function resetSite(extras = {}) {
|
||||
const siteAttrs = {
|
||||
...siteFixtures["site.json"].site,
|
||||
...extras,
|
||||
siteSettings,
|
||||
};
|
||||
|
||||
PreloadStore.store("site", cloneJSON(siteAttrs));
|
||||
|
@ -311,9 +310,10 @@ export function acceptance(name, optionsOrCallback) {
|
|||
if (settingChanges) {
|
||||
mergeSettings(settingChanges);
|
||||
}
|
||||
|
||||
this.siteSettings = currentSettings();
|
||||
|
||||
resetSite(currentSettings(), siteChanges);
|
||||
resetSite(siteChanges);
|
||||
|
||||
this.container = getOwner(this);
|
||||
|
||||
|
|
|
@ -313,7 +313,7 @@ export default function setupTests(config) {
|
|||
});
|
||||
|
||||
PreloadStore.reset();
|
||||
resetSite(settings);
|
||||
resetSite();
|
||||
|
||||
sinon.stub(ScrollingDOMMethods, "screenNotFull");
|
||||
sinon.stub(ScrollingDOMMethods, "bindOnScroll");
|
||||
|
|
Loading…
Reference in New Issue