From 3468848bca64134551aab79745f1632483077ab1 Mon Sep 17 00:00:00 2001 From: Christina Chortaria Date: Tue, 13 Aug 2024 18:01:16 -0400 Subject: [PATCH] Fix views specs Disable eslint // eslint-disable-line no-unused-vars --- app/javascript/entrypoints/application.js | 7 ++++--- spec/features/scheduled_message_spec.rb | 8 ++++---- .../locker_applications/edit.html.erb_spec.rb | 6 +++--- .../locker_applications/new.html.erb_spec.rb | 6 +++--- .../locker_violations/edit.html.erb_spec.rb | 2 +- spec/views/lockers/edit.html.erb_spec.rb | 20 +++++++++---------- spec/views/lockers/new.html.erb_spec.rb | 20 +++++++++---------- .../edit.html.erb_spec.rb | 2 +- 8 files changed, 36 insertions(+), 35 deletions(-) diff --git a/app/javascript/entrypoints/application.js b/app/javascript/entrypoints/application.js index aa5552b..955b88d 100644 --- a/app/javascript/entrypoints/application.js +++ b/app/javascript/entrypoints/application.js @@ -1,9 +1,10 @@ // eslint-disable-next-line no-unused-vars import { createApp } from 'vue'; import lux from 'lux-design-system'; -import Rails from '@rails/ujs'; // we need to import Rails so vite adds it to the module -import CopyToClipboard from '../components/copy_to_clipboard'; -import LockerSizeFilter from '../components/locker_size_filter'; +// we need to import Rails so vite adds it to the module +import Rails from '@rails/ujs'; // eslint-disable-line no-unused-vars +import CopyToClipboard from '../components/copy_to_clipboard'; // eslint-disable-line no-unused-vars +import LockerSizeFilter from '../components/locker_size_filter'; // eslint-disable-line no-unused-vars import 'lux-design-system/dist/style.scss'; import 'lux-design-system/dist/style.css'; diff --git a/spec/features/scheduled_message_spec.rb b/spec/features/scheduled_message_spec.rb index 0e1ec8d..7d58603 100644 --- a/spec/features/scheduled_message_spec.rb +++ b/spec/features/scheduled_message_spec.rb @@ -39,8 +39,8 @@ it 'can create a new Firestone scheduled message' do visit '/locker_renewal_messages/new' - fill_in 'Scheduled date', with: Time.zone.today.strftime('%m/%d/%y') - fill_in 'Range covered', with: "#{Time.zone.today.strftime('%m/%d/%y')} - #{Time.zone.today.strftime('%m/%d/%y')}" + fill_in 'schedule', with: Time.zone.today.strftime('%m/%d/%y') + fill_in 'applicable_range', with: "#{Time.zone.today.strftime('%m/%d/%y')} - #{Time.zone.today.strftime('%m/%d/%y')}" expect do click_button 'Submit' @@ -70,8 +70,8 @@ it 'can create a new Lewis scheduled message' do visit '/locker_renewal_messages/new' - fill_in 'Scheduled date', with: Time.zone.today.strftime('%m/%d/%y') - fill_in 'Range covered', with: "#{Time.zone.today.strftime('%m/%d/%y')} - #{Time.zone.today.strftime('%m/%d/%y')}" + fill_in 'schedule', with: Time.zone.today.strftime('%m/%d/%y') + fill_in 'applicable_range', with: "#{Time.zone.today.strftime('%m/%d/%y')} - #{Time.zone.today.strftime('%m/%d/%y')}" expect do click_button 'Submit' diff --git a/spec/views/locker_applications/edit.html.erb_spec.rb b/spec/views/locker_applications/edit.html.erb_spec.rb index 5d2062b..b9a135f 100644 --- a/spec/views/locker_applications/edit.html.erb_spec.rb +++ b/spec/views/locker_applications/edit.html.erb_spec.rb @@ -36,7 +36,7 @@ assert_select 'lux-input-select[name=?]', 'locker_application[status_at_application]' - assert_select 'input-text[name=?]', 'locker_application[department_at_application]' + assert_select 'lux-input-text[name=?]', 'locker_application[department_at_application]' assert_select 'input[type=hidden][name=?]', 'locker_application[user_uid]' end @@ -64,10 +64,10 @@ assert_select 'lux-input-select[name=?]', 'locker_application[status_at_application]' - assert_select 'input-text[name=?]', 'locker_application[department_at_application]' + assert_select 'lux-input-text[name=?]', 'locker_application[department_at_application]' assert_select 'input[type=hidden][name=?]', 'locker_application[user_uid]', count: 0 - assert_select 'input-text[name=?]', 'locker_application[user_uid]' + assert_select 'lux-input-text[name=?]', 'locker_application[user_uid]' end end end diff --git a/spec/views/locker_applications/new.html.erb_spec.rb b/spec/views/locker_applications/new.html.erb_spec.rb index ca6e8f5..bcfdedb 100644 --- a/spec/views/locker_applications/new.html.erb_spec.rb +++ b/spec/views/locker_applications/new.html.erb_spec.rb @@ -66,7 +66,7 @@ assert_select 'lux-input-select[name=?]', 'locker_application[status_at_application]', value: 'junior' - assert_select 'input-text[name=?]', 'locker_application[department_at_application]', value: 'department' + assert_select 'lux-input-text[name=?]', 'locker_application[department_at_application]', value: 'department' assert_select 'input[type=hidden][name=?]', 'locker_application[user_uid]' end @@ -89,11 +89,11 @@ assert_select 'lux-input-select[name=?]', 'locker_application[status_at_application]', value: 'junior' - assert_select 'input-text[name=?]', 'locker_application[department_at_application]', value: 'department' + assert_select 'lux-input-text[name=?]', 'locker_application[department_at_application]', value: 'department' assert_select 'input[type=hidden][name=?]', 'locker_application[user_uid]', count: 0 - assert_select 'input-text[name=?]', 'locker_application[user_uid]', value: user.uid + assert_select 'lux-input-text[name=?]', 'locker_application[user_uid]', value: user.uid end end end diff --git a/spec/views/locker_violations/edit.html.erb_spec.rb b/spec/views/locker_violations/edit.html.erb_spec.rb index 250a95b..b48f716 100644 --- a/spec/views/locker_violations/edit.html.erb_spec.rb +++ b/spec/views/locker_violations/edit.html.erb_spec.rb @@ -28,7 +28,7 @@ assert_select 'form[action=?][method=?]', locker_violation_path(@locker_violation), 'post' do assert_select 'input[type=hidden][name=?]', 'locker_violation[user_id]' assert_select 'input[type=hidden][name=?]', 'locker_violation[locker_id]' - assert_select 'input-text[name=?]', 'locker_violation[number_of_books]' + assert_select 'lux-input-text[name=?]', 'locker_violation[number_of_books]' expect(rendered).not_to match(/There is no user currently assigned to the locker!/) end end diff --git a/spec/views/lockers/edit.html.erb_spec.rb b/spec/views/lockers/edit.html.erb_spec.rb index 1d5f70d..4b50cc3 100644 --- a/spec/views/lockers/edit.html.erb_spec.rb +++ b/spec/views/lockers/edit.html.erb_spec.rb @@ -31,25 +31,25 @@ assert_select 'input[type="checkbox"][name=?]', 'locker[accessible]' - assert_select 'input-text[name=?]', 'locker[location]' + assert_select 'lux-input-text[name=?]', 'locker[location]' - assert_select 'input-text[name=?]', 'locker[notes]' + assert_select 'lux-input-text[name=?]', 'locker[notes]' - assert_select 'input-text[name=?]', 'locker[combination]' + assert_select 'lux-input-text[name=?]', 'locker[combination]' - assert_select 'input-text[name=?]', 'locker[code]' + assert_select 'lux-input-text[name=?]', 'locker[code]' - assert_select 'input-text[name=?]', 'locker[tag]' + assert_select 'lux-input-text[name=?]', 'locker[tag]' - assert_select 'input-text[name=?]', 'locker[discs]' + assert_select 'lux-input-text[name=?]', 'locker[discs]' - assert_select 'input-text[name=?]', 'locker[clutch]' + assert_select 'lux-input-text[name=?]', 'locker[clutch]' - assert_select 'input-text[name=?]', 'locker[hubpos]' + assert_select 'lux-input-text[name=?]', 'locker[hubpos]' - assert_select 'input-text[name=?]', 'locker[key_number]' + assert_select 'lux-input-text[name=?]', 'locker[key_number]' - assert_select 'input-text[name=?]', 'locker[general_area]' + assert_select 'lux-input-text[name=?]', 'locker[general_area]' end end end diff --git a/spec/views/lockers/new.html.erb_spec.rb b/spec/views/lockers/new.html.erb_spec.rb index e95063f..b52b6f5 100644 --- a/spec/views/lockers/new.html.erb_spec.rb +++ b/spec/views/lockers/new.html.erb_spec.rb @@ -25,7 +25,7 @@ render assert_select 'form[action=?][method=?]', lockers_path, 'post' do - assert_select 'input-text[name=?]', 'locker[location]', value: 'location' + assert_select 'lux-input-text[name=?]', 'locker[location]', value: 'location' assert_select 'lux-input-select[name=?]', 'locker[size]', value: '4' @@ -33,23 +33,23 @@ assert_select 'input[type="checkbox"][name=?]', 'locker[accessible]', value: false - assert_select 'input-text[name=?]', 'locker[notes]', value: 'notes' + assert_select 'lux-input-text[name=?]', 'locker[notes]', value: 'notes' - assert_select 'input-text[name=?]', 'locker[combination]', value: 'combination' + assert_select 'lux-input-text[name=?]', 'locker[combination]', value: 'combination' - assert_select 'input-text[name=?]', 'locker[code]', value: 'code' + assert_select 'lux-input-text[name=?]', 'locker[code]', value: 'code' - assert_select 'input-text[name=?]', 'locker[tag]', value: 'tag' + assert_select 'lux-input-text[name=?]', 'locker[tag]', value: 'tag' - assert_select 'input-text[name=?]', 'locker[discs]', value: 'discs' + assert_select 'lux-input-text[name=?]', 'locker[discs]', value: 'discs' - assert_select 'input-text[name=?]', 'locker[clutch]', value: 'clutch' + assert_select 'lux-input-text[name=?]', 'locker[clutch]', value: 'clutch' - assert_select 'input-text[name=?]', 'locker[hubpos]', value: 'hubpos' + assert_select 'lux-input-text[name=?]', 'locker[hubpos]', value: 'hubpos' - assert_select 'input-text[name=?]', 'locker[key_number]', value: 'num' + assert_select 'lux-input-text[name=?]', 'locker[key_number]', value: 'num' - assert_select 'input-text[name=?]', 'locker[general_area]', value: 'general_area' + assert_select 'lux-input-text[name=?]', 'locker[general_area]', value: 'general_area' end end end diff --git a/spec/views/study_room_violations/edit.html.erb_spec.rb b/spec/views/study_room_violations/edit.html.erb_spec.rb index 0ddaf5b..a67f420 100644 --- a/spec/views/study_room_violations/edit.html.erb_spec.rb +++ b/spec/views/study_room_violations/edit.html.erb_spec.rb @@ -27,7 +27,7 @@ assert_select 'form[action=?][method=?]', study_room_violation_path(@study_room_violation), 'post' do assert_select 'input[type=hidden][name=?]', 'study_room_violation[user_id]' assert_select 'input[type=hidden][name=?]', 'study_room_violation[study_room_id]' - assert_select 'input-text[name=?]', 'study_room_violation[number_of_books]' + assert_select 'lux-input-text[name=?]', 'study_room_violation[number_of_books]' expect(rendered).not_to match(/There is no user currently assigned to the study room!/) end end