diff options
author | Martin Hanzel <mhanzel@gitlab.com> | 2019-07-26 10:18:15 +0300 |
---|---|---|
committer | Kushal Pandya <kushalspandya@gmail.com> | 2019-07-26 10:18:15 +0300 |
commit | c111d121d6faedfe3f38af1780e16ab056048e30 (patch) | |
tree | d7ae3d46966cfa5a499bb3a8532334bad11c0b94 /spec/features/projects | |
parent | 96ae5bd83da31350e9856a290127d7aa1469710a (diff) |
Add UndoStack class - a custom undo/redo engine
It will be hooked up to the markdown editor later
Diffstat (limited to 'spec/features/projects')
-rw-r--r-- | spec/features/projects/wiki/user_creates_wiki_page_spec.rb | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/spec/features/projects/wiki/user_creates_wiki_page_spec.rb b/spec/features/projects/wiki/user_creates_wiki_page_spec.rb index aac095bfa6b..80741ace5d6 100644 --- a/spec/features/projects/wiki/user_creates_wiki_page_spec.rb +++ b/spec/features/projects/wiki/user_creates_wiki_page_spec.rb @@ -132,9 +132,15 @@ describe "User creates wiki page" do fill_in(:wiki_content, with: ascii_content) - page.within(".wiki-form") do - click_button("Create page") - end + # This is the dumbest bug in the world: + # When the #wiki_content textarea is filled in, JS captures the `Enter` keydown event in order to do + # auto-indentation and manually inserts a newline. However, for whatever reason, when you try to click on the + # submit button in Capybara, it will not trigger the `click` event if a \n or \r character has been manually + # added to the textarea. It will, however, trigger ALL OTHER EVENTS, including `mouseover`/down/up, focus, and + # blur. Just not `click`. But only when you manually insert \n or \r - if you manually insert any other sequence + # then `click` is fired normally. And it's only Capybara. Browsers and JSDOM don't have this issue. + # So that's why the next line performs the click via JS. + page.execute_script("document.querySelector('.qa-create-page-button').click()") page.within ".md" do expect(page).to have_selector(".katex", count: 3).and have_content("2+2 is 4") |