Closed scherztc closed 2 months ago
This error message comes up as we try to get rid of a User that's never created in the first place. It's not getting created because the test is failing first, with this error:
RSpec::Core::MultipleExceptionError: Error: "calc(100vh - 110px)" is not a number for `min'
on line 1:30625 of stdin, in function `min`
from line 1:30625 of stdin
>> x;flex:1;flex-direction:column;max-height:min(650px,calc(100vh - 110px));ove
You can reproduce the errors by running these tests: spec/features/welcome_mailer_spec.rb
Running the following test also creates the error:
require 'rails_helper'
RSpec.describe 'Your Feature Test', type: :feature do
it 'prints the Chrome version' do
visit '/'
browser_version = page.driver.browser.capabilities.version
puts "Chrome Version: #{browser_version}"
end
end
There seems to be an issue with compiling the CSS, which then causes the Error: "calc(100vh - 110px)" is not a number for
min'` error to show up with visiting any page.
What was going on was the test wasn't being run with javascript. Adding the following to the rails_helper file resolved the errors in this file and in multiple other ones:
# Configure Capybara to use Selenium with Chrome in headless mode for JS-enabled feature tests
config.before(:each, type: :feature, js: true) do
Capybara.javascript_driver = :selenium_chrome_headless
end
Adding this resolved the min(calc()) error for other tests as well.
Descriptive summary
Expected behavior
Actual behavior
Steps to reproduce the behavior
Related work
Link to related issues or prior related work here.