Skip to content

Conversation

bprize15
Copy link

@bprize15 bprize15 commented Jun 4, 2024

@bprize15 bprize15 requested a review from calvinlu3 June 4, 2024 16:52
Copy link
Contributor

Choose a reason for hiding this comment

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

I would try to change the mock data to include a combination of red and yellow badges as well as non-outdated VUS.

Copy link
Contributor

Choose a reason for hiding this comment

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

Looks cut off at the top

Copy link
Author

Choose a reason for hiding this comment

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

Changed to mutation collapsible based on our conversation

@bprize15 bprize15 requested a review from calvinlu3 June 4, 2024 21:54
@@ -37,6 +37,13 @@ export interface BaseCollapsibleProps {
showLoadingSpinner?: boolean;
}

function getDataTestid(dataTestid: string, identifier: React.ReactNode) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Why is the type of identifier not string?

Copy link
Author

Choose a reason for hiding this comment

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

We allow a React.ReactNode to be passed in as the collapsible title for greater flexibility. In this case, I just do a check to make sure it's a string

Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks for clarifying. I wonder what's the best practice to assigning data-testid.

Is it better to manually generate unique test ids for each element in a list-like component.
Or, should we query for all element with data-testid='sample-id' (which will return a list) and use indices to get the one you're looking for? (ie in react-testing-library, there is a function getAllByTestId)

Copy link
Author

Choose a reason for hiding this comment

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

I don't think we need the extra step of querying all elements with a testid and then using the index. Seems straightforward enough to just use the title. Could even use the uuid if we want, but I think that might be overkill, especially since we control the test data.

Copy link
Contributor

Choose a reason for hiding this comment

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

The V600E collapsible is missing the hotspot and exon information. I assume you need to mock the request for it to show

Comment on lines +113 to +114
'Date.now': process.env.DOCKER ? `() => ${DEFAULT_DATE}` : 'Date.now',
'new Date()': process.env.DOCKER ? `new Date(${DEFAULT_DATE})` : 'new Date()',
Copy link
Contributor

Choose a reason for hiding this comment

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

Will this be picked up if we run tests locally and not through docker?

Copy link
Author

Choose a reason for hiding this comment

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

This will not. I think it's just an edge case that we should leave alone (and not introduce additional complexity). The tests will fail anyway if run locally since the screen size will be off. The only reason I would ever run the tests locally is during development so you don't need to keep rebuilding the image. Running the tests locally should always be expected to fail.

@bprize15 bprize15 requested a review from calvinlu3 June 5, 2024 17:28
@bprize15 bprize15 merged commit cfbdbf8 into oncokb:rc Jun 6, 2024
@bprize15 bprize15 deleted the add-more-screenshot-tests branch June 6, 2024 16:27
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