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

ui: Service Instance forwards/backwards/forwards navigation test #9532

Conversation

johncowen
Copy link
Contributor

@johncowen johncowen commented Jan 8, 2021

aka the 'in/out/in' test, aka 'The Hokey Cokey Test ™️ '

This PR is additional to #9524 and is the base branch for this PR.

Here we add a test for clicking forwards and backwards, and then forwards again between the Service Detail page and the Service Instance detail page, to prove that the fix in #9524 works.

I undid the fix to verify that this was failing with a 404 before the fix, redoing the fix makes the tests pass.

Notes:

We cheated a little here as in the app we call the same endpoint in quick succession one after the other and we have no generic way of mocking this absolutely realistically from within our acceptance tests. We rely on the fact that the list of instances from consul are then filtered by the UI to only give us the instance we are interested in. This means we can put as many different instances in the mocked response as we like, with all different ids, from all different services (which would never happen in Consul), and this will then satisfy the mocks we need for the test.

Alternatively we could have included some conditionals in the mock-api template, but this I'm not sure how generically we would have done that.

Longer term some sort of 'Given 1 instance model on request.0 from yaml', 'Given 2 instance models on request.1 from yaml' or similar might be a nice addition.

@johncowen johncowen added the theme/ui Anything related to the UI label Jan 8, 2021
@johncowen johncowen requested a review from kaxcode January 8, 2021 15:19
Copy link
Contributor

@kaxcode kaxcode left a comment

Choose a reason for hiding this comment

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

LGTM

@johncowen johncowen merged this pull request into ui/bug/error-service-instance-redirect Jan 12, 2021
@johncowen johncowen deleted the ui/bug/error-service-instance-redirect-plus-test branch January 12, 2021 09:34
@johncowen johncowen restored the ui/bug/error-service-instance-redirect-plus-test branch January 12, 2021 14:37
@johncowen johncowen deleted the ui/bug/error-service-instance-redirect-plus-test branch April 26, 2021 11:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
theme/ui Anything related to the UI
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants