Skip to content

Commit

Permalink
Merge pull request #8777 from alphagov/0000-visual-editor-fix
Browse files Browse the repository at this point in the history
Fix reference to visual editor JS
  • Loading branch information
dnkrj authored Jan 30, 2024
2 parents f567e10 + f5d0360 commit 349154f
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
2 changes: 1 addition & 1 deletion app/views/components/_govspeak_editor.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -101,5 +101,5 @@
<p class="govuk-error-message" dir="ltr">There is an error in your Markdown. Select Back to edit and review your markdown.</p>
<% 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 %>
12 changes: 12 additions & 0 deletions test/components/govspeak_editor_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 349154f

Please sign in to comment.