-
-
Notifications
You must be signed in to change notification settings - Fork 719
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
Selecting OC redirects to shop's home page #12076
Comments
Hi Filipe, I would like to work on this, when an order cycle is selected it activates activateDefaultPanel() {:
This takes the user to the default page which is the home page, since this function is only triggered when an order cycle is selected, can I modify it to take the user to the shopping page instead? I am not sure how this would be tested in the spec, wouldn't I need to test this in tabs_and_panels_controller_tests.js? |
Doing so, enables a homepage for that enterprise, which surfaces issue openfoodfoundation#12076. The test as been set as pending, which needs to be changed when the issue is fixed
Hey @basilawwad , Thanks so much for checking this issue.
I can't answer but it sounds like it is worth a try :-)
That might be a possibility as well, I'm not very familiar with the js testing framework. My suggestion would be rather to change a system spec, and enable a homepage for an enterprise in a context in which more than one order cycle is available for selection. I've made a PR here, to demonstrate what I mean. Please feel free to cherry pick that commit if you find it useful. |
Hi @basilawwad
It looks like Let us know if you have any questions ! |
…ct_pending_test_for_12076 [Pending spec] Updates distributor to have a shopfront message (reproduces #12076)
Hi, I am a bit stuck on this one, the specs are failing although when I test the same scenarios manually they seem to be showing the correct page. I checked the capybara screenshots and they seem to be showing the correct panel when the tests fail. What's confusing me a bit, is that the tests are passing if I return the old default function that loads the home panel instead of the shop panel. Any advice on how to handle this? |
Hey @basilawwad , thanks for your work on this! The error on the build is:
So, rspec expects the spec to fail, but it does not -> so it throws an error (which makes it actually fail!). The solution should be to remove the line mentioning After you commit this change, the build should be green again - it looks like you've fixed the issue 💪 |
Hi @filipefurtad0 @rioug, Thank you both for your help, all the tests are passing in the PR now, I thought the modification made to the spec by Felipe was enough to test the scenario. Let me know what you think. |
Doing so, enables a homepage for that enterprise, which surfaces issue openfoodfoundation#12076. The test as been set as pending, which needs to be changed when the issue is fixed
Description
Regression from #5748 / #5072.
Reported here.
If a shop has a home page set, then selecting an OC from a shop redirects redirected to the home page instead of the shop page. This happens each time an order cycle is selected.
Expected Behavior
Selecting an OC from a shop redirects redirected to the home page instead of the shop.
Actual Behaviour
Steps to Reproduce
As hub/admin:
admin/edit#/shop_preferences_panel
, type some text in the Shopfront Message and save changes )As a customer:
2. Visit the shopfront.
3. Select any tab (other than the Homepage tab)
4. Select an order cycle
5. Notice you're being redirected to the Homepage and not the Shop tab
Animated Gif/Screenshot
Taken from here:
Enregistrement.de.l.ecran.2024-01-23.a.10.30.49.mov
Workaround
The current workaround is deleting the home page, which is not really a good workaround.
Severity
priority bug-s3: a feature is broken but there is a workaround
Your Environment
Possible Fix
Ideally, the PR closing this issue should improve the test case in the relevant spec, since it the enterprise has no homepage set.
The text was updated successfully, but these errors were encountered: