Skip to content

Commit

Permalink
fix: project settings dashbboard tests (#701)
Browse files Browse the repository at this point in the history
* fix: project settings dashbboard tests

Signed-off-by: 4nalog <[email protected]>

* chore: remove .only

Signed-off-by: 4nalog <[email protected]>

* refactor: remove empty waitFor

Signed-off-by: 4nalog <[email protected]>

---------

Signed-off-by: 4nalog <[email protected]>
  • Loading branch information
4nalog authored Mar 3, 2023
1 parent ce3216e commit b15470b
Showing 1 changed file with 16 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import {
} from 'models/Project/api';
import { Admin } from '@flyteorg/flyteidl-types';
import * as LocalCache from 'basics/LocalCache';
import { LocalCacheProvider } from 'basics/LocalCache/ContextProvider';
import { ProjectDashboard } from '../ProjectDashboard';
import { failedToLoadExecutionsString } from '../constants';

Expand Down Expand Up @@ -141,25 +142,31 @@ describe('ProjectDashboard', () => {
render(
<MemoryRouter>
<QueryClientProvider client={queryClient}>
<ProjectDashboard projectId={scope.project} domainId={scope.domain} />
<LocalCacheProvider>
<ProjectDashboard
projectId={scope.project}
domainId={scope.domain}
/>
</LocalCacheProvider>
</QueryClientProvider>
</MemoryRouter>,
);

it('should display domain attributes section when config was provided', async () => {
const { getByText } = renderView();
expect(getProjectAttributes).toHaveBeenCalled();
expect(getProjectDomainAttributes).toHaveBeenCalled();
await waitFor(() => {
expect(getProjectAttributes).toHaveBeenCalled();
});

await waitFor(() => {
expect(getByText('Domain Settings')).toBeInTheDocument();
expect(
getByText('cliOutputLocationPrefixFromProjectAttributes'),
).toBeInTheDocument();
expect(getByText('cliAnnotationKey')).toBeInTheDocument();
expect(
getByText('cliAnnotationValueFromProjectAttributes'),
).not.toBeInTheDocument();
});

expect(
getByText('cliOutputLocationPrefixFromProjectAttributes'),
).toBeInTheDocument();
expect(getByText('cliAnnotationKey')).toBeInTheDocument();
});

it('should show loading spinner', async () => {
Expand Down

0 comments on commit b15470b

Please sign in to comment.