Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

日報のテキストエリアの高さが自動で大きくなることを確認するテストを追加 #4143

Merged
merged 2 commits into from
Feb 9, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions test/system/reports_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -597,4 +597,27 @@ class ReportsTest < ApplicationSystemTestCase
assert_selector 'h1', text: 'h1'
end
end

test 'automatically resizes textarea of a new report' do
visit_with_auth '/reports/new', 'komagata'
fill_in('report[description]', with: 'test')
height = find('#report_description').style('height')['height'][/\d+/].to_i

fill_in('report[description]', with: "\n1\n2\n3\n4\n5\n6\7\n8\n9\n10\n11\n12\n13\n14\n15")
after_height = find('#report_description').style('height')['height'][/\d+/].to_i

assert height < after_height
end

test 'automatically resizes textarea of an edit report' do
visit_with_auth report_path(reports(:report1)), 'komagata'
click_link '内容修正'

height = find('#report_description').style('height')['height'][/\d+/].to_i

fill_in('report[description]', with: "\n1\n2\n3\n4\n5\n6\7\n8\n9\n10\n11\n12\n13\n14\n15")
after_height = find('#report_description').style('height')['height'][/\d+/].to_i

assert height < after_height
end
end