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

@ -82,6 +82,7 @@ function initializeDiscourseLocalDates(api) {
});
api.modifyClass("component:d-editor", {
pluginId: "discourse-local-dates",
actions: {
insertDiscourseLocalDate(toolbarEvent) {
showModal("discourse-local-dates-create-modal").setProperties({