mirror of
https://github.com/discourse/discourse.git
synced 2024-11-24 05:07:53 +08:00
clean up callbacks during acceptance tests
This commit is contained in:
parent
4194886b62
commit
70179290f3
|
@ -16,6 +16,10 @@ import { userPath } from 'discourse/lib/url';
|
|||
|
||||
const customPostMessageCallbacks = {};
|
||||
|
||||
export function resetCustomPostMessageCallbacks() {
|
||||
customPostMessageCallbacks = {};
|
||||
}
|
||||
|
||||
export function registerCustomPostMessageCallback(type, callback) {
|
||||
if (customPostMessageCallbacks[type]) {
|
||||
throw `Error ${type} is an already registered post message!`;
|
||||
|
|
|
@ -10,6 +10,7 @@ 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';
|
||||
import { resetCustomPostMessageCallbacks } from 'discourse/controllers/topic';
|
||||
|
||||
export function currentUser() {
|
||||
return Discourse.User.create(sessionFixtures['/session/current.json'].current_user);
|
||||
|
@ -107,6 +108,7 @@ export function acceptance(name, options) {
|
|||
clearRewrites();
|
||||
initSearchData();
|
||||
resetDecorators();
|
||||
resetCustomPostMessageCallbacks();
|
||||
Discourse.reset();
|
||||
}
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue
Block a user