Skip to content
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

fix: project settings dashbboard tests #701

Merged
merged 3 commits into from
Mar 3, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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