Skip to content

Commit

Permalink
Fix views specs
Browse files Browse the repository at this point in the history
Disable eslint // eslint-disable-line no-unused-vars
  • Loading branch information
christinach committed Aug 14, 2024
1 parent 9c091ac commit 3468848
Show file tree
Hide file tree
Showing 8 changed files with 36 additions and 35 deletions.
7 changes: 4 additions & 3 deletions app/javascript/entrypoints/application.js
Original file line number Diff line number Diff line change
@@ -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';

Expand Down
8 changes: 4 additions & 4 deletions spec/features/scheduled_message_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down Expand Up @@ -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'
Expand Down
6 changes: 3 additions & 3 deletions spec/views/locker_applications/edit.html.erb_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions spec/views/locker_applications/new.html.erb_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion spec/views/locker_violations/edit.html.erb_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
20 changes: 10 additions & 10 deletions spec/views/lockers/edit.html.erb_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
20 changes: 10 additions & 10 deletions spec/views/lockers/new.html.erb_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,31 +25,31 @@
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'

assert_select 'lux-input-select[name=?]', 'locker[floor]', value: 'floor'

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
2 changes: 1 addition & 1 deletion spec/views/study_room_violations/edit.html.erb_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 3468848

Please sign in to comment.