-
Notifications
You must be signed in to change notification settings - Fork 72
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
「読みました」のチェックボックスを埋めたら「休会する」ボタンを押せるようにした #5461
Changes from 13 commits
6b74788
073ee4f
0e27b25
6dd821b
358cc07
39435ff
22bea4c
b81f5d2
5cfd3a6
598e5d4
b5d4e52
169b029
1676ce0
b4f3f09
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
document.addEventListener('DOMContentLoaded', () => { | ||
const checkbox = document.querySelector('.js-hibernation-agreements-checkbox') | ||
const submit = document.querySelector('.js-hibernation-agreements-submit') | ||
|
||
checkbox.addEventListener('change', () => { | ||
if (checkbox.checked) { | ||
submit.classList.remove('is-disabled') | ||
submit.classList.add('is-danger') | ||
} else { | ||
submit.classList.add('is-disabled') | ||
submit.classList.remove('is-danger') | ||
} | ||
}) | ||
}) |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,6 +19,7 @@ class HibernationTest < ApplicationSystemTestCase | |
end | ||
|
||
VCR.use_cassette 'subscription/update', vcr_options do | ||
find('.is-checkbox').click | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. こちらcapybaraのcheckboxをチェックするためのメソッドは使えなかったでしょうか。 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @komagata |
||
click_on '休会する' | ||
page.driver.browser.switch_to.alert.accept | ||
assert_text '休会処理が完了しました' | ||
|
@@ -31,6 +32,7 @@ class HibernationTest < ApplicationSystemTestCase | |
fill_in('hibernation[reason]', with: 'test') | ||
end | ||
|
||
find('.is-checkbox').click | ||
click_on '休会する' | ||
page.driver.browser.switch_to.alert.accept | ||
assert_text '復帰予定日を入力してください' | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,6 +22,7 @@ class Notification::HibernationTest < ApplicationSystemTestCase | |
visit_with_auth new_hibernation_path, 'kimura' | ||
fill_in 'hibernation[scheduled_return_on]', with: Time.current.next_month | ||
fill_in 'hibernation[reason]', with: 'テストのため' | ||
find('.is-checkbox').click | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. このページにcheckboxが増えたらテストが落ちる感じのセンシティブなテストになっているので、もう少し絞り込んだ条件が良さそうです。 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @komagata |
||
accept_confirm do | ||
click_button '休会する' | ||
end | ||
|
@@ -44,6 +45,7 @@ class Notification::HibernationTest < ApplicationSystemTestCase | |
visit_with_auth new_hibernation_path, 'kensyu' | ||
fill_in 'hibernation[scheduled_return_on]', with: Time.current.next_month | ||
fill_in 'hibernation[reason]', with: 'テストのため' | ||
find('.is-checkbox').click | ||
accept_confirm do | ||
click_button '休会する' | ||
end | ||
|
@@ -66,6 +68,7 @@ class Notification::HibernationTest < ApplicationSystemTestCase | |
visit_with_auth new_hibernation_path, 'senpai' | ||
fill_in 'hibernation[scheduled_return_on]', with: Time.current.next_month | ||
fill_in 'hibernation[reason]', with: 'テストのため' | ||
find('.is-checkbox').click | ||
accept_confirm do | ||
click_button '休会する' | ||
end | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍