Skip to content

Commit

Permalink
Digital object component default values
Browse files Browse the repository at this point in the history
  • Loading branch information
blacksmith-welder committed Dec 21, 2024
1 parent 3e8b1ac commit 2270f52
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,16 @@ Feature: Digital Object Component Edit Default Values
Background:
Given an administrator user is logged in
And the Pre-populate Records option is checked in Repository Preferences
And a Digital Object has been created
And the user is on the Digital Objects page
Scenario: Open Digital Object Component Edit Default values page
Scenario: Edit Default Values of Digital Object Component
When the user clicks on 'Edit Default Values'
And the user clicks on 'Digital Object Component' in the dropdown menu
Then the Digital Object Component Defaults page is displayed
Scenario: Edit Default Values of Digital Object Component
Given a Digital Object has been created
And the user is on the Digital Object Component Defaults page
When the user fills in 'Label' with 'Test label'
And the user fills in 'Title' with 'Test title'
And the user clicks on 'Save Digital Object Component'
Then the 'Defaults' updated message is displayed
And the new Digital Object Component form has the following default values
| form_section | form_field | form_value |
| Basic Information | Label | Test label |
| Basic Information | Title | Test title |
| form_section | form_field | form_value |
| Basic Information | Label | Test label |
| Basic Information | Title | Test title |
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,24 @@
end
end
end

Then 'the new Digital Object Component form has the following default values' do |form_values_table|
visit "#{STAFF_URL}/digital_objects/#{@digital_object_id}/edit"
wait_for_ajax
click_on 'Add Child'
wait_for_ajax

form_values = form_values_table.hashes

form_values.each do |row|
section_title = find('h3', text: row['form_section'])
section = section_title.ancestor('section')
expect(section[:id]).to_not eq nil

within section do
field = find_field(row['form_field'])

expect(field.value.downcase).to eq row['form_value'].downcase
end
end
end

0 comments on commit 2270f52

Please sign in to comment.