Skip to content

Commit

Permalink
Merge branch 'master' into np/unit-test2
Browse files Browse the repository at this point in the history
  • Loading branch information
nilscognite authored Feb 26, 2025
2 parents c0796ae + a7a94a5 commit e390b24
Show file tree
Hide file tree
Showing 10 changed files with 902 additions and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ type Story = StoryObj<typeof AdvancedTreeView>;

export default meta;

const stk = new CogniteClientMock();
const baseLoader = new CadNodesLoader(stk, { revisionId: 1, modelId: 1 }, 10);
const sdk = new CogniteClientMock();
const baseLoader = new CadNodesLoader(sdk, { revisionId: 1, modelId: 1 }, 10);

export const base: Story = {
name: 'base',
Expand All @@ -51,7 +51,7 @@ export const base: Story = {
}
};

const loader = new CadNodesLoader(stk, { revisionId: 1, modelId: 1 }, 10);
const loader = new CadNodesLoader(sdk, { revisionId: 1, modelId: 1 }, 10);

export const Main: Story = {
name: 'main',
Expand Down Expand Up @@ -80,7 +80,7 @@ export const Main: Story = {
<StyledButton
size="small"
onClick={async () => {
const nodeId = stk.getRandomNodeId();
const nodeId = sdk.getRandomNodeId();
await loader.forceNodeInTree(nodeId).then((selectedNode) => {
if (selectedNode === undefined) {
return;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,15 @@ describe('ToolbarFactory', () => {
test('should test get toolbar', () => {
const tool = new FooTool();
const toolBar = getToolbar(tool);
expect(toolBar).not.toBe(undefined);
expect(toolBar).toBeDefined();
if (toolBar !== undefined) {
expect(toolBar.length).toEqual(2);
}
});

test('should test can not get toolbar', () => {
const tool = new BarTool();
expect(getToolbar(tool)).toBe(undefined);
expect(getToolbar(tool)).toBeUndefined();
});
});

Expand Down
Loading

0 comments on commit e390b24

Please sign in to comment.