Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Unit test for browsing page #2851
base: main
Are you sure you want to change the base?
Unit test for browsing page #2851
Changes from all commits
ae145bc
24dbd85
17d87f2
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
You've got some superfluous blank characters, here.
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.
This change doesn't seem like it should be in a unit testing commit/PR.
This file was deleted.
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.
In this context, do we have a "root" configured, so that we don't have to use relative import paths? (I.e., can we just import this
from "App"
orfrom
./Appbecause the root is
src`?) Ditto for the other modules.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.
Are there any other attributes that we should be checking?
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.
This is specifically a mock for
/api/v1/datasets/list
with specific metadata requested. I think it would be better to give this a more specific name than just "MOCK_DATA", especially with the suggestion that a file named "mockData.js" might provide mocks for other APIs as well?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.
Should this be refactored into a common module and reused in all the tests?
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.
Shouldn't we be checking that the UI has updated from
YYYY-MM-DD
to2022-02-16
?Also, can the code here look at the values in the React-store? I think those would be good things to check, as well.
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.
It looks to me like these assertions will fit on one line, so there's no need to use local variables for them (in-lining the expressions will cut the number of new lines of code in half...).
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.
A similar comment applies to
dashboard/src/modules/components/TableComponent/Table.test.js
, and perhaps elsewhere.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.
Teach me something: why do we use
require()
here instead ofimport
?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.
Looks like you need to run Prettier again. 🙃
It would be good to develop a habit of running Prettier before each commit.
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.
I'm still a bit concerned about the generic name
MOCK_DATA
... this mocks the response of/datasets/list
, but we'll certainly want to have other mocks in the future to test additional parts of the dashboard.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.
The
/datasets/list
response format has changed. There's now a "results" field in the JSON as well as a "next_url" for paging. Also, the dashboard now relies on theresource_id
.