uclibs / ucrate

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

Bug: Clicking "Attaching a file" does not update active tab selector #1121

Open Janell-Huyck opened 8 months ago

Janell-Huyck commented 8 months ago

Descriptive summary

The test it 'matches active tab to form content' do from file spec/features/form_tab_nav_js_spec.rb:39 fails. The instructions click_link "Attaching a file" will take the user down the page to the section on attaching a file, but it does NOT update the "active" tab as it should according to the test line expect(page).to have_selector("ul li.active a", text: 'Files')

When I attempted to update the test from expect(page).to have_selector("ul li.active a", Files') to expect(page).to have_selector("ul li.active a", text: 'Files') to get rid of a Capybara warning, this test started failing. What's going on is that previously "Files" wasn't actually being passed in to Capybara. There was indeed an "active" list item in the unordered list, but the active item had the text "Metadata" not "Files". When I added the capybara selector text:, it started looking for an active list item of "Files" but that doesn't exist on the page.

The bug lies in the workflow for "Navigating the tabs in the create work form".

Expected behavior

When the user clicks on "Attaching a file", the page jumps to the appropriate section and the active tab selector will change from "Metadata" to "Files".

Actual behavior

The page jumps to the requested location, but the active tab selector does not change

Discovered with PR #1120