mirror of
https://github.com/discourse/discourse.git
synced 2025-02-21 00:43:54 +08:00
Reset widget decorators after each test
This commit is contained in:
parent
d75eb23231
commit
243ee565dc
@ -32,6 +32,10 @@ export function applyDecorators(widget, type, attrs, state) {
|
||||
return [];
|
||||
}
|
||||
|
||||
export function resetDecorators() {
|
||||
Object.keys(_decorators).forEach(key => delete _decorators[key]);
|
||||
}
|
||||
|
||||
const _customSettings = {};
|
||||
export function changeSetting(widgetName, settingName, newValue) {
|
||||
_customSettings[widgetName] = _customSettings[widgetName] || {};
|
||||
|
@ -9,6 +9,7 @@ import { clearHTMLCache } from 'discourse/helpers/custom-html';
|
||||
import { flushMap } from 'discourse/models/store';
|
||||
import { clearRewrites } from 'discourse/lib/url';
|
||||
import { initSearchData } from 'discourse/widgets/search-menu';
|
||||
import { resetDecorators } from 'discourse/widgets/widget';
|
||||
|
||||
export function currentUser() {
|
||||
return Discourse.User.create(sessionFixtures['/session/current.json'].current_user);
|
||||
@ -99,6 +100,7 @@ export function acceptance(name, options) {
|
||||
resetPluginApi();
|
||||
clearRewrites();
|
||||
initSearchData();
|
||||
resetDecorators();
|
||||
Discourse.reset();
|
||||
}
|
||||
});
|
||||
|
Loading…
x
Reference in New Issue
Block a user