diff --git a/app/views/components/_govspeak_editor.html.erb b/app/views/components/_govspeak_editor.html.erb index c14b44a6f32..7d88cf3c2bd 100644 --- a/app/views/components/_govspeak_editor.html.erb +++ b/app/views/components/_govspeak_editor.html.erb @@ -101,5 +101,5 @@

There is an error in your Markdown. Select Back to edit and review your markdown.

<% end %> - <%= javascript_include_tag "components/govspeak-visual-editor", :type => "module" if show_visual_editor %> + <%= javascript_include_tag "components/visual-editor", :type => "module" if show_visual_editor %> <% end %> diff --git a/test/components/govspeak_editor_test.rb b/test/components/govspeak_editor_test.rb index 2192c61185e..58524b60ce4 100644 --- a/test/components/govspeak_editor_test.rb +++ b/test/components/govspeak_editor_test.rb @@ -162,4 +162,16 @@ def component_name assert_select ".app-c-govspeak-editor[data-alternative-format-provider-id='123'][data-image-ids='[1,2,3]'][data-attachment-ids='[3,4,5]']" assert_select ".govuk-textarea", text: "This is an attachment: !@1 This is an image: !!1" end + + test "includes visual editor button" do + render_component({ + name: "my-name", + label: { + text: "my-label", + }, + show_visual_editor: true, + }) + + assert_select ".js-app-c-govspeak-editor__visual-editor-button", text: "Visual Editor Alpha" + end end