FIX: In test mode, initializers were modifying classes over and over

This adds a new property, `pluginId` which you can pass to `modifyClass`
which prevent the class from being modified over and over again.

This also includes a fix for polls which was leaking state between tests
which this new functionality exposed.
This commit is contained in:
Robin Ward
2021-09-01 14:29:07 -04:00
parent fa66d1fa82
commit 09764291b1
6 changed files with 66 additions and 19 deletions

View File

@ -15,6 +15,7 @@ function initializeDetails(api) {
});
api.modifyClass("controller:composer", {
pluginId: "discourse-details",
actions: {
insertDetails() {
this.toolbarEvent.applySurround(