Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🥔✨ Marketplace: #restore Products and DeliveryAreas #2074

Merged
merged 1 commit into from
Jan 4, 2024

Conversation

zspencer
Copy link
Member

This allows a Product and DeliveryArea to be Restored; and also makes their forms look the same.

- #2014
- #2023

This allows a `Product` and `DeliveryArea` to be Restored; and also
makes their forms look the same.
@zspencer zspencer requested review from a team December 28, 2023 03:01
visit(polymorphic_path(marketplace.location(child: :delivery_areas)))
click_link("Archived Delivery Areas")
within("##{dom_id(delivery_area)}") do
click_link("Edit")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there any chance delivery area data persists/leaks across cases so you'd want to do click_link("Edit", :match => :first) etc...?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The within('##{dom_id(delivery_area)}') do ... end scopes this click_link to child elements of the DOM element with the delivery area's ID. This should mitigate leakage across test case runs.

That said, leakage across test case runs are very unlikely to the point of "not worth worrying about" in most rails apps using RSpec because of rspec's transactional fixtures feature.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OH right right I see that scope now. Coolio.

@zspencer zspencer merged commit 178bdf7 into main Jan 4, 2024
4 checks passed
@zspencer zspencer deleted the marketplace/delivery-areas-may-be-restored branch January 4, 2024 01:59
@@ -9,7 +9,7 @@ def create?
alias_method :update?, :create?

def permitted_attributes(_)
[:label, :price, :order_by, :delivery_window]
[:label, :price, :order_by, :delivery_window, :restore]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it ruby/rails syntax convention to horizontally stack lists? I guess I've gotten used to left-aligned vertical lists for collections so I find them easier to scan that way. 😅

Copy link
Member Author

@zspencer zspencer Jan 4, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Eh, it's kind of a "six in one half dozen in the other" for me. I can imagine there's legibility benefits to vertical lists rather than horizontal ones; and am happy to receive feedback or patches on a case-by-case basis for where it's useful; or even add linter rule if it's something we want to enforce more broadly.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll think about it 🤨

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants