added unit test improvements for CustomPropertyTable and Users components (#9802)

This commit is contained in:
Aniket Katkar 2023-01-19 16:56:02 +05:30 committed by GitHub
parent d7cf3acf9f
commit 3dcccb1f14
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 4 deletions

View File

@ -248,9 +248,9 @@ describe('Test User Component', () => {
wrapper: MemoryRouter,
}
);
const inheritedRoles = await findByTestId(container, 'loader');
const loader = await findByTestId(container, 'loader');
expect(inheritedRoles).toBeInTheDocument();
expect(loader).toBeInTheDocument();
});
it('Following tab should show loader if the data is loading', async () => {
@ -260,8 +260,8 @@ describe('Test User Component', () => {
wrapper: MemoryRouter,
}
);
const inheritedRoles = await findByTestId(container, 'loader');
const loader = await findByTestId(container, 'loader');
expect(inheritedRoles).toBeInTheDocument();
expect(loader).toBeInTheDocument();
});
});

View File

@ -118,5 +118,11 @@ describe('Test CustomProperty Table Component', () => {
// To check if loader was rendered when the loading state was true and then removed after loading is false
await waitForElementToBeRemoved(() => screen.getByTestId('loader'));
const noDataPlaceHolder = await screen.findByText(
'ErrorPlaceHolder.component'
);
expect(noDataPlaceHolder).toBeInTheDocument();
});
});