Skip to content

Commit 433d561

Browse files
committed
refactor(tests): update imports to use @launchdarkly/js-client-sdk
- Changed import paths in test files to reflect the new SDK structure. - Updated mock implementations to align with the new SDK methods. - Ensured compatibility with existing tests by adjusting mock behavior.
1 parent 7e8f370 commit 433d561

5 files changed

Lines changed: 6 additions & 6 deletions

File tree

packages/toolbar/src/core/tests/ContextItem.test.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { render, screen, fireEvent, waitFor } from '@testing-library/react';
22
import { expect, test, describe, vi, beforeEach } from 'vitest';
3-
import type { LDContext } from 'launchdarkly-js-client-sdk';
3+
import type { LDContext } from '@launchdarkly/js-client-sdk';
44
import { ContextItem } from '../ui/Toolbar/components/new/Contexts/ContextItem';
55
import { ContextsProvider } from '../ui/Toolbar/context/api/ContextsProvider';
66
import '@testing-library/jest-dom/vitest';

packages/toolbar/src/core/tests/ContextsProvider.test.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { render, screen, waitFor, act } from '@testing-library/react';
22
import { expect, test, describe, vi, beforeEach } from 'vitest';
3-
import type { LDContext } from 'launchdarkly-js-client-sdk';
3+
import type { LDContext } from '@launchdarkly/js-client-sdk';
44
import { ContextsProvider, useContextsContext } from '../ui/Toolbar/context/api/ContextsProvider';
55
import '@testing-library/jest-dom/vitest';
66
import React from 'react';

packages/toolbar/src/core/tests/createToolbarFlagFunction.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { describe, test, expect, vi, beforeEach } from 'vitest';
2-
import type { LDClient } from 'launchdarkly-js-client-sdk';
2+
import type { LDClient } from '@launchdarkly/js-client-sdk';
33
import {
44
createToolbarFlagFunction,
55
setToolbarFlagClient,

packages/toolbar/src/core/tests/hooks/AfterEvaluationHook.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { describe, it, expect, beforeEach, vi } from 'vitest';
22
import { AfterEvaluationHook, type AfterEvaluationHookConfig } from '../../../types/hooks/AfterEvaluationHook';
3-
import type { EvaluationSeriesData, EvaluationSeriesContext, LDEvaluationDetail } from 'launchdarkly-js-sdk-common';
3+
import type { EvaluationSeriesData, EvaluationSeriesContext, LDEvaluationDetail } from '@launchdarkly/js-client-sdk-common';
44
import { EventFilter, ProcessedEvent } from '../../../types';
55

66
// Mock console methods to avoid noise in test output

packages/toolbar/src/core/tests/hooks/AfterIdentifyHook.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { describe, it, expect, beforeEach, vi } from 'vitest';
22
import { AfterIdentifyHook, type AfterIdentifyHookConfig } from '../../../types/hooks/AfterIdentifyHook';
3-
import type { IdentifySeriesData, IdentifySeriesContext, IdentifySeriesResult } from 'launchdarkly-js-sdk-common';
3+
import type { IdentifySeriesData, IdentifySeriesContext, IdentifySeriesResult } from '@launchdarkly/js-client-sdk-common';
44
import { EventFilter, ProcessedEvent } from '../../../types';
55

66
// Mock console methods to avoid noise in test output
@@ -106,7 +106,7 @@ describe('AfterIdentifyHook', () => {
106106

107107
it('should handle contexts without key', () => {
108108
const contextWithoutKey = {
109-
context: { kind: 'user', name: 'No Key User' },
109+
context: { kind: 'user', name: 'No Key User', key: '' },
110110
};
111111
hook.afterIdentify(contextWithoutKey, mockData, mockResult);
112112

0 commit comments

Comments
 (0)