From afb747d5060e4cdc93eb554431623229af559092 Mon Sep 17 00:00:00 2001 From: Koji Ishimoto Date: Thu, 14 Mar 2024 01:04:24 +0900 Subject: [PATCH] =?UTF-8?q?reports=E3=83=86=E3=82=B9=E3=83=88=E3=81=AEclic?= =?UTF-8?q?k=20unwatch=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- test/system/reports_test.rb | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) diff --git a/test/system/reports_test.rb b/test/system/reports_test.rb index 4091521e40e..1e0bb98e78a 100644 --- a/test/system/reports_test.rb +++ b/test/system/reports_test.rb @@ -348,25 +348,11 @@ class ReportsTest < ApplicationSystemTestCase assert_selector '.thread-comment-form' end - # 画面上では更新の完了がわからないため、やむを得ずsleepする - # 注意)安易に使用しないこと!! https://bootcamp.fjord.jp/pages/use-assert-text-instead-of-wait-for-vuejs - def wait_for_watch_change - sleep 1 - end - - test 'unwatch' do - visit_with_auth report_path(reports(:report1)), 'kimura' - assert_difference('Watch.count', -1) do - find('div.a-watch-button', text: 'Watch中').click - wait_for_watch_change - end - end - test 'click unwatch' do visit_with_auth report_path(reports(:report1)), 'kimura' assert_difference('Watch.count', -1) do - find('div.a-watch-button', text: 'Watch中').click - wait_for_watch_change + find('button.a-watch-button', text: 'Watch中').click + assert_no_text 'Watch中' end end