Merge remote-tracking branch 'origin/feature/wiki--update-placeholder-texts' into ckeditor-integration

pull/6445/head
Oliver Günther 6 years ago
commit cb7c371277
No known key found for this signature in database
GPG Key ID: A3A8BDAD7C0C552C
  1. 3
      frontend/src/app/components/modals/editor/editor-macros.service.ts
  2. 13
      spec/features/wysiwyg/macros/child_pages_spec.rb
  3. 7
      spec/features/wysiwyg/macros/include_wiki_page_spec.rb

@ -61,7 +61,8 @@ export class EditorMacrosService {
*/
public configureWikiPageInclude(page:string):Promise<string> {
return new Promise<string>((resolve, _) => {
const modal = this.opModalService.show(WikiIncludePageMacroModal, { page: page });
const pageValue = page || '';
const modal = this.opModalService.show(WikiIncludePageMacroModal, { page: pageValue });
modal.closingEvent.subscribe((modal:WikiIncludePageMacroModal) => {
if (modal.changed) {
resolve(modal.page);

@ -94,6 +94,10 @@ describe 'Wysiwyg child pages spec',
# Find widget, click to show toolbar
placeholder = find('.macro.-child_pages')
# Placeholder states `this page` and no `Include parent`
expect(placeholder).to have_text('this page')
expect(placeholder).not_to have_text('Include parent')
# Edit widget and cancel again
placeholder.click
page.find('.ck-balloon-panel .ck-button', visible: :all, text: 'Edit').click
@ -110,6 +114,9 @@ describe 'Wysiwyg child pages spec',
# Save widget
find('.op-modal--submit-button').click
# Placeholder states `parent-page` and no `Include parent`
expect(placeholder).to have_text('parent-page')
expect(placeholder).not_to have_text('Include parent')
end
# Save wiki page
@ -126,7 +133,7 @@ describe 'Wysiwyg child pages spec',
find('.toolbar .icon-edit').click
end
editor.in_editor do |container, editable|
editor.in_editor do |_container, _editable|
# Find widget, click to show toolbar
placeholder = find('.macro.-child_pages')
@ -138,6 +145,10 @@ describe 'Wysiwyg child pages spec',
# Save widget
find('.op-modal--submit-button').click
# Placeholder states `parent-page` and `Include parent`
expect(placeholder).to have_text('parent-page')
expect(placeholder).to have_text('Include parent')
end
# Save wiki page

@ -96,10 +96,13 @@ describe 'Wysiwyg include wiki page spec',
find('.op-modal--submit-button').click
# Find widget, click to show toolbar
modal = find('.macro.-wiki_page_include')
placeholder = find('.macro.-wiki_page_include')
# Placeholder states `included`
expect(placeholder).to have_text('included')
# Edit widget again
modal.click
placeholder.click
page.find('.ck-balloon-panel .ck-button', visible: :all, text: 'Edit').click
expect(page).to have_field('selected-page', with: 'included')
find('.op-modal--cancel-button').click

Loading…
Cancel
Save