Skip to content

Conversation

@debdeep12
Copy link

No description provided.

@google-cla
Copy link

google-cla bot commented Jan 4, 2023

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@github-actions
Copy link
Contributor

github-actions bot commented Jan 4, 2023

Thank you for raising the request! RAD Lab admins have been notified.

@github-actions
Copy link
Contributor

github-actions bot commented Jan 4, 2023

Apache 2.0 License check successful!

Copy link
Contributor

@acolver acolver left a comment

Choose a reason for hiding this comment

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

Can you please write some unit tests with several mock deployments that test the search, filtering, and sorting functionality? I see tests that check if the components are rendering, but we also want tests that check the functionality.

expect(linkElement2).toBeInTheDocument()
expect(linkElement2).toBeEnabled()
const allDeployments = screen.getByTestId("all-deployments")
isAdmin && expect(allDeployments).toBeInTheDocument()
Copy link
Contributor

Choose a reason for hiding this comment

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

why have isAdmin here? It's always true.

Comment on lines +81 to +92
it("should show all deployment lists", async () => {
render(
<BrowserRouter>
<ModuleDeployment
headers={DEPLOYMENT_HEADERS}
deployments={deploymentMockData}
defaultSortField={SORT_FIELD.CREATEDAT}
defaultSortDirection={SORT_DIRECTION.DESC}
/>
</BrowserRouter>,
)
})
Copy link
Contributor

Choose a reason for hiding this comment

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

There are no assertions here

</div>
{deploymentTab === DEPLOYMENT_TAB.ALL && (
<>
{listAllDeployments?.length ? (
Copy link
Contributor

Choose a reason for hiding this comment

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

You don't need this first check

Copy link
Author

@debdeep12 debdeep12 Jan 18, 2023

Choose a reason for hiding this comment

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

renderEmptySearch() is a function which will be used when we search and find that no data is present according to search and renderEmptyState() is used when there is no deployment.

Copy link
Author

Choose a reason for hiding this comment

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

Should I write some other logic to handle the condition?

)}
{deploymentTab === DEPLOYMENT_TAB.MINE && (
<>
{listMyDeployments?.length ? (
Copy link
Contributor

Choose a reason for hiding this comment

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

You don't need this first check

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