Skip to content

Commit

Permalink
stubs
Browse files Browse the repository at this point in the history
  • Loading branch information
jmthibault79 committed Oct 7, 2024
1 parent a39d5f5 commit b0a12c2
Show file tree
Hide file tree
Showing 8 changed files with 14 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ interface NavProps {

const WorkspaceNavigation = (props: NavProps) => {
const {
workspace: { displayName, namespace, terraName },
workspace: { namespace, displayName, terraName },
style,
} = props;
const url = dataTabPath(namespace, terraName);
Expand Down
2 changes: 1 addition & 1 deletion ui/src/app/pages/workspace/featured-workspaces.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ describe('Featured Workspace List', () => {
});
expect(
screen.queryByText(
WorkspaceStubVariables.DEFAULT_WORKSPACE_NAME +
WorkspaceStubVariables.DEFAULT_WORKSPACE_DISPLAY_NAME +
featuredCategory[index]
)
).toBeInTheDocument();
Expand Down
4 changes: 3 additions & 1 deletion ui/src/app/pages/workspace/workspace-about.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,9 @@ describe('WorkspaceAbout', () => {
name: /share/i,
})
);
screen.getByText('Share ' + WorkspaceStubVariables.DEFAULT_WORKSPACE_NAME);
screen.getByText(
'Share ' + WorkspaceStubVariables.DEFAULT_WORKSPACE_DISPLAY_NAME
);
});

test.each([
Expand Down
6 changes: 3 additions & 3 deletions ui/src/app/pages/workspace/workspace-edit.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -663,15 +663,15 @@ describe(WorkspaceEdit.name, () => {

const numBefore = workspacesApi.workspaceOperations.length;
await userEvent.click(
await screen.findByRole('button', {
name: /Duplicate Workspace/i,
})
await screen.findByRole('button', { name: /Duplicate Workspace/i })
);

const confirmSaveButton = await screen.findByRole('button', {
name: 'Confirm',
});

// multiple clicks

await user.click(confirmSaveButton);
await user.click(confirmSaveButton);
await user.click(confirmSaveButton);
Expand Down
2 changes: 1 addition & 1 deletion ui/src/app/utils/cdr-versions.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import {
import { WorkspaceStubVariables } from 'testing/stubs/workspaces';

const stubWorkspace: Workspace = {
displayName: WorkspaceStubVariables.DEFAULT_WORKSPACE_NAME,
displayName: WorkspaceStubVariables.DEFAULT_WORKSPACE_DISPLAY_NAME,
terraName: WorkspaceStubVariables.DEFAULT_WORKSPACE_TERRA_NAME,
namespace: WorkspaceStubVariables.DEFAULT_WORKSPACE_NS,
};
Expand Down
2 changes: 1 addition & 1 deletion ui/src/testing/stubs/cohorts-api-stub.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ export class CohortsApiStub extends CohortsApi {
super(undefined);

const stubWorkspace: Workspace = {
displayName: WorkspaceStubVariables.DEFAULT_WORKSPACE_NAME,
displayName: WorkspaceStubVariables.DEFAULT_WORKSPACE_DISPLAY_NAME,
terraName: WorkspaceStubVariables.DEFAULT_WORKSPACE_TERRA_NAME,
namespace: WorkspaceStubVariables.DEFAULT_WORKSPACE_NS,
};
Expand Down
2 changes: 1 addition & 1 deletion ui/src/testing/stubs/workspaces-api-stub.ts
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ export class WorkspacesApiStub extends WorkspacesApi {
return new Promise<WorkspaceResourceResponse>((resolve) => {
const workspace: WorkspaceData = {
namespace: workspaceNamespace,
displayName: WorkspaceStubVariables.DEFAULT_WORKSPACE_NAME,
displayName: WorkspaceStubVariables.DEFAULT_WORKSPACE_DISPLAY_NAME,
terraName,
accessLevel: WorkspaceAccessLevel.OWNER,
cdrVersionId: CdrVersionsStubVariables.DEFAULT_WORKSPACE_CDR_VERSION_ID,
Expand Down
6 changes: 3 additions & 3 deletions ui/src/testing/stubs/workspaces.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,16 @@ import { CdrVersionsStubVariables } from './cdr-versions-api-stub';

export class WorkspaceStubVariables {
static DEFAULT_WORKSPACE_NS = 'defaultNamespace';
static DEFAULT_WORKSPACE_NAME = 'defaultWorkspace';
static DEFAULT_WORKSPACE_TERRA_NAME = 'one';
static DEFAULT_WORKSPACE_DISPLAY_NAME = 'Default Workspace';
static DEFAULT_WORKSPACE_TERRA_NAME = 'defaultworkspace';
static DEFAULT_WORKSPACE_PERMISSION = WorkspaceAccessLevel.OWNER;
static DEFAULT_GOOGLE_PROJECT_ID = 'terra-vpc-sc-test';
static DEFAULT_GOOGLE_BUCKET_NAME = 'fc-secure-bucket';
}

export function buildWorkspaceStub(suffix = ''): Workspace {
return {
displayName: WorkspaceStubVariables.DEFAULT_WORKSPACE_NAME + suffix,
displayName: WorkspaceStubVariables.DEFAULT_WORKSPACE_DISPLAY_NAME + suffix,
terraName: WorkspaceStubVariables.DEFAULT_WORKSPACE_TERRA_NAME + suffix,
googleProject: WorkspaceStubVariables.DEFAULT_GOOGLE_PROJECT_ID + suffix,
googleBucketName:
Expand Down

0 comments on commit b0a12c2

Please sign in to comment.