From 5eb458eabb63ad4325a7cfa2f8dd537328e5329b Mon Sep 17 00:00:00 2001 From: Ilia Mashkov Date: Wed, 3 Jun 2026 08:57:04 +0300 Subject: [PATCH] refactor(ComparisonView): import typography store via root barrel comparisonStore reached getTypographySettingsStore through $features/AdjustTypography/model (deep, past the public API) while the catalog/lifecycle accessors already go through the $entities/Font root barrel. Re-path to $features/AdjustTypography so all three composed-store imports go through public APIs uniformly. Direction was always legal (widget -> feature, downward); this only closes the deep-import inconsistency. Consolidate the spec mock onto the root module accordingly and drop the now-dead /model mock. --- .../model/stores/comparisonStore.svelte.ts | 2 +- .../model/stores/comparisonStore.test.ts | 15 ++++++--------- 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/src/widgets/ComparisonView/model/stores/comparisonStore.svelte.ts b/src/widgets/ComparisonView/model/stores/comparisonStore.svelte.ts index 4be6115..1f2bb28 100644 --- a/src/widgets/ComparisonView/model/stores/comparisonStore.svelte.ts +++ b/src/widgets/ComparisonView/model/stores/comparisonStore.svelte.ts @@ -26,7 +26,7 @@ import { import { type TypographySettingsStore, getTypographySettingsStore, -} from '$features/AdjustTypography/model'; +} from '$features/AdjustTypography'; import { createPersistentStore } from '$shared/lib'; import { untrack } from 'svelte'; import { getPretextFontString } from '../../lib'; diff --git a/src/widgets/ComparisonView/model/stores/comparisonStore.test.ts b/src/widgets/ComparisonView/model/stores/comparisonStore.test.ts index b151733..021193a 100644 --- a/src/widgets/ComparisonView/model/stores/comparisonStore.test.ts +++ b/src/widgets/ComparisonView/model/stores/comparisonStore.test.ts @@ -84,6 +84,12 @@ vi.mock('$entities/Font/model', async importOriginal => { }; }); +const mockTypography = vi.hoisted(() => ({ + weight: 400, + renderedSize: 48, + reset: vi.fn(), +})); + vi.mock('$features/AdjustTypography', () => ({ DEFAULT_TYPOGRAPHY_CONTROLS_DATA: [], createTypographyControlManager: vi.fn(() => ({ @@ -91,15 +97,6 @@ vi.mock('$features/AdjustTypography', () => ({ renderedSize: 48, reset: vi.fn(), })), -})); - -const mockTypography = vi.hoisted(() => ({ - weight: 400, - renderedSize: 48, - reset: vi.fn(), -})); - -vi.mock('$features/AdjustTypography/model', () => ({ getTypographySettingsStore: () => mockTypography, }));