Skip to content

Commit

Permalink
Add test
Browse files Browse the repository at this point in the history
  • Loading branch information
danieldiekmeier committed Feb 2, 2024
1 parent 31672ce commit 96ec801
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions spec/system/leaves_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -67,4 +67,19 @@
expect(status.slack_id).to eq "slack-john"
expect(status.until_time).to eq Time.zone.today.end_of_day
end

it "shows a warning if one of the leave days is in the past" do
login :john
visit leaves_path
click_on "Request leave"

expect(page).not_to have_content "Heads up: Some of the selected days are in the past."

within ".modal" do
find(".flatpickr-prev-month").click
first(".dayContainer .flatpickr-day").click
end

expect(page).to have_content "Heads up: Some of the selected days are in the past."
end
end

0 comments on commit 96ec801

Please sign in to comment.