Skip to content

Commit

Permalink
Merge pull request #8381 from fjordllc/chore/fix-search-test
Browse files Browse the repository at this point in the history
検索機能のテストを修正
  • Loading branch information
komagata authored Mar 5, 2025
2 parents 399817c + 681767e commit 12f34c4
Showing 1 changed file with 16 additions and 14 deletions.
30 changes: 16 additions & 14 deletions test/system/searchables_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,31 +3,33 @@
require 'application_system_test_case'

class SearchablesTest < ApplicationSystemTestCase
test 'search All ' do
test 'search with word' do
visit_with_auth '/', 'hatsuno'
search_word = '検索結果テスト用'
within('form[name=search]') do
select 'すべて'
fill_in 'word', with: '検索結果テスト用'
fill_in 'word', with: search_word
end
find('#test-search').click
assert_text 'お知らせの検索結果テスト用'
assert_text 'プラクティスの検索結果テスト用'
assert_text '日報の検索結果テスト用'
assert_text '提出物の検索結果テスト用'
assert_text 'Q&Aの検索結果テスト用'
assert_text 'Docsの検索結果テスト用'
assert_text 'イベントの検索結果テスト用'
assert_text '定期イベントの検索結果テスト用'
summaries = all('.card-list-item__summary')
summaries.each do |summary|
assert_includes summary.text, search_word
end
end

test 'search reports ' do
test 'search with document_type' do
visit_with_auth '/', 'hatsuno'
document_type = '日報'
within('form[name=search]') do
select '日報'
fill_in 'word', with: 'テストの日報'
select document_type
end
find('#test-search').click
assert_text 'テストの日報'
labels = all('.card-list-item__label')
assert_equal labels.count, 50
assert_equal labels[3].text, document_type
labels.each do |label|
assert_equal label.text, document_type
end
end

test 'search events' do
Expand Down

0 comments on commit 12f34c4

Please sign in to comment.