Wait for js component to mount before editing (#17239)
This test had been failing with "title can't be blank" a few times recently. Looking for a difference between the v2 form template (in app/views/articles) and the ArticleForm component (in app/javascript/article-form/) showed there is an id on the js form but not the erb/html form we respond with first. The test had been sometimes typing the title into the text area before the component mounts, and trying to view the article gives a validation error rather than the expected response.
This commit is contained in:
parent
61ccc29fed
commit
44ab69ae4e
1 changed files with 5 additions and 4 deletions
|
|
@ -98,11 +98,12 @@ RSpec.describe "Using the editor", type: :system do
|
|||
describe "using v2 editor", js: true do
|
||||
it "fill out form with rich content and click publish" do
|
||||
visit "/new"
|
||||
fill_in "article-form-title", with: "This is a <span> test"
|
||||
fill_in "tag-input", with: "What, Yo"
|
||||
fill_in "article_body_markdown", with: "Hello"
|
||||
within "form#article-form" do
|
||||
fill_in "article-form-title", with: "This is a <span> test"
|
||||
fill_in "tag-input", with: "What, Yo"
|
||||
fill_in "article_body_markdown", with: "Hello"
|
||||
end
|
||||
find("button", text: /\APublish\z/).click
|
||||
|
||||
expect(page).to have_xpath("//div[@class='crayons-article__header__meta']//h1")
|
||||
expect(page).to have_text("Hello")
|
||||
expect(page).to have_link("what", href: "/t/what")
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue