-
Notifications
You must be signed in to change notification settings - Fork 261
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
Adding e2e tests for pages which use middleware to redirect #10945
Conversation
3906cbd
to
579098c
Compare
Also removed a couple files that were obviously broken and didn't redirect to anything.
@@ -89,7 +89,7 @@ export const routerOptions = { | |||
name: 'account-create-key' | |||
}, | |||
{ | |||
path: 'auth', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -99,7 +99,7 @@ export const routerOptions = { | |||
name: 'c-cluster-ecm' | |||
}, | |||
{ | |||
path: 'settings', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -14,7 +14,7 @@ global.TextEncoder = TextEncoder; | |||
global.TextDecoder = TextDecoder; | |||
|
|||
Vue.config.productionTip = false; | |||
Vue.use(i18n, { store: { dispatch() {} } }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Made this change in regards to #10923 (comment)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For me, the test coverage seems fine, but I do not grasp why it should redirect and if this is common in all these pages, would it not be better a unit test at this point?
It obviously does not exclude having both or any issue to have just E2E, so it's just a simple curiosity.
Most of these redirects don't have any logic so I was planning to move them as redirects defined in the router config. This would change the units all together so I'd have to rewrite all the unit tests and therefore I wouldn't be verifying that I didn't change behavior. I could just make the changes and maybe write some router unit tests without this verification step. I'm okay with either. Let me know which you'd prefer. |
I would expect just to change the spied function, although I may completely miss the actual case.
I tend to stick to an already done work, especially if is also fine. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Summary
Also fixed a couple routes, and removed some test setup code that was commented on in another review.
Technical notes summary
I wanted to put these tests in place before changing or removing the middleware to make sure we keep the experience consistent.
Areas or cases that should be tested
These are the tests.
Areas which could experience regressions
None
Checklist