uclibs / ucrate

Scholar@UC: University of Cincinnati's self-submission institutional repository
https://scholar.uc.edu
Other
5 stars 3 forks source link

HUT : welcome_email #1139

Closed scherztc closed 2 months ago

scherztc commented 9 months ago

Descriptive summary

   586.2) Failure/Error: User.find_by_email(user_email).delete

          NoMethodError:
            undefined method `delete' for nil:NilClass
          # ./spec/features/welcome_mailer_spec.rb:21:in `block (2 levels) in <top (required)>'

Expected behavior

Actual behavior

Steps to reproduce the behavior

  1. Do this
  2. Then do this...

Related work

Link to related issues or prior related work here.

Janell-Huyck commented 9 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

Janell-Huyck commented 9 months ago

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 formin'` error to show up with visiting any page.

Janell-Huyck commented 9 months ago

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.

scherztc commented 2 months ago

Closed by JIRA : https://ucdts.atlassian.net/browse/LIBSCHOLAR-15?atlOrigin=eyJpIjoiOWNkNWZkYjdjODQ1NGI1MDllODY1YzAxMzI1OWM1M2MiLCJwIjoiaiJ9