mirror of
https://github.com/discourse/DiscoTOC.git
synced 2026-09-29 04:44:01 -04:00
DEV: Switch theme to use new addComposerToolbarPopupMenuOption api (#61)
Why this change? The new API is better and allows us to avoid modifying the composer service.
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import I18n from "I18n";
|
||||
import {
|
||||
acceptance,
|
||||
exists,
|
||||
@@ -19,7 +20,10 @@ acceptance("DiscoTOC - Composer", function (needs) {
|
||||
await click("#create-topic");
|
||||
const toolbarPopupMenu = selectKit(".toolbar-popup-menu-options");
|
||||
await toolbarPopupMenu.expand();
|
||||
await toolbarPopupMenu.selectRowByValue("insertDtoc");
|
||||
|
||||
await toolbarPopupMenu.selectRowByName(
|
||||
I18n.t(themePrefix("insert_table_of_contents"))
|
||||
);
|
||||
|
||||
assert.ok(query(".d-editor-input").value.includes('data-theme-toc="true"'));
|
||||
});
|
||||
@@ -33,7 +37,10 @@ acceptance("DiscoTOC - Composer", function (needs) {
|
||||
|
||||
const toolbarPopupMenu = selectKit(".toolbar-popup-menu-options");
|
||||
await toolbarPopupMenu.expand();
|
||||
await toolbarPopupMenu.selectRowByValue("insertDtoc");
|
||||
|
||||
await toolbarPopupMenu.selectRowByName(
|
||||
I18n.t(themePrefix("insert_table_of_contents"))
|
||||
);
|
||||
|
||||
assert.ok(query(".d-editor-input").value.includes('data-theme-toc="true"'));
|
||||
});
|
||||
@@ -44,6 +51,10 @@ acceptance("DiscoTOC - Composer", function (needs) {
|
||||
const toolbarPopupMenu = selectKit(".toolbar-popup-menu-options");
|
||||
await toolbarPopupMenu.expand();
|
||||
|
||||
assert.notOk(toolbarPopupMenu.rowByValue("insertDtoc").exists());
|
||||
assert.notOk(
|
||||
toolbarPopupMenu
|
||||
.rowByName(I18n.t(themePrefix("insert_table_of_contents")))
|
||||
.exists()
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user