Skip to content

Commit

Permalink
Address Field: Add super-scaffolding tests (#986)
Browse files Browse the repository at this point in the history
* add address_field to super_scaffolding partial tests

* add more tests for address fields in tangible_thing_test

* Update test/bin/setup-super-scaffolding-system-test

* Update test/system/tangible_thing_test.rb

* Update test/system/tangible_thing_test.rb

---------

Co-authored-by: Jeremy Green <[email protected]>
  • Loading branch information
pascallaliberte and jagthedrummer authored Oct 3, 2023
1 parent c353bd4 commit 6dea486
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 1 deletion.
3 changes: 2 additions & 1 deletion test/bin/setup-super-scaffolding-system-test
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,8 @@ bin/super-scaffold crud PartialTest Team \
super_select_test:super_select \
multiple_super_select_test:super_select{multiple} \
number_field_test:number_field \
text_area_test:text_area --navbar="ti-layout"
text_area_test:text_area \
address_test:address_field --navbar="ti-layout"

# The test for this webhook is run inline in .circleci/config.yml.
bin/super-scaffold incoming-webhooks SomeProvider
Expand Down
16 changes: 16 additions & 0 deletions test/system/super_scaffolding_partial_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,15 @@ def setup
# Number Field Partial
fill_in "Number Field Test", with: 47

assert page.has_content? "State / Province / Region"
select "United States", from: "Country"
assert page.has_content? "State"

fill_in "Address", with: "123 Main St."
fill_in "City", with: "New York"
select "New York", from: "State"
fill_in "Zip code", with: "10001"

click_on "Create Partial Test"
assert_text("Partial Test was successfully created.")

Expand Down Expand Up @@ -206,6 +215,13 @@ def setup
# Number Field
refute_nil partial_test.number_field_test
assert_equal partial_test.number_field_test, 47
# Address Field
refute_nil partial_test.address_test
assert_equal partial_test.address_test.address_one, "123 Main St."
assert_equal partial_test.address_test.city, "New York"
assert_equal partial_test.address_test.country_id, 233
assert_equal partial_test.address_test.region_id, 1452
assert_equal partial_test.address_test.postal_code, "10001"
end
end
end
11 changes: 11 additions & 0 deletions test/system/tangible_thing_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,13 @@ class TangibleThingTest < ApplicationSystemTestCase
assert page.has_content? "State / Province"
select "Japan", from: "Country"
assert page.has_content? "Prefecture"
select "United States", from: "Country"
assert page.has_content? "State"

fill_in "Address", with: "123 Main St."
fill_in "City", with: "New York"
select "New York", from: "State"
fill_in "Zip code", with: "10001"

select "One", from: "Super Select Value"
select2_select "Multiple Super Select Values", ["Five", "Six"]
Expand All @@ -78,6 +85,10 @@ class TangibleThingTest < ApplicationSystemTestCase
assert_text "One"
assert_text "Five and Six"
assert_text "Long text for this text area field"
assert_text "123 Main St."
assert_text "New York"
assert_text "UNITED STATES"
assert_text "10001"

click_on "Edit Tangible Thing"

Expand Down

0 comments on commit 6dea486

Please sign in to comment.