From 8b5c9b44cd44492481708c029e253ed5aa6b86f3 Mon Sep 17 00:00:00 2001 From: "Pavel.Samusev" Date: Mon, 9 Dec 2024 15:07:24 +0300 Subject: [PATCH] [Fix] Update to newly shared components version (#232) --- package.json | 2 +- src/components/shared/Panel.styles.ts | 2 +- .../variables/VariablesPanel.styles.ts | 2 +- .../imageVariable/useMediaDetails.test.ts | 16 ++++++++-------- yarn.lock | 8 ++++---- 5 files changed, 15 insertions(+), 15 deletions(-) diff --git a/package.json b/package.json index 13af2d01..fb00485d 100644 --- a/package.json +++ b/package.json @@ -27,7 +27,7 @@ }, "dependencies": { "@babel/preset-env": "^7.25.3", - "@chili-publish/grafx-shared-components": "^0.88.5", + "@chili-publish/grafx-shared-components": "^0.88.7", "@chili-publish/studio-sdk": "^1.17.2-rc.1", "@fortawesome/fontawesome-svg-core": "^6.7.1", "@fortawesome/pro-light-svg-icons": "^6.7.1", diff --git a/src/components/shared/Panel.styles.ts b/src/components/shared/Panel.styles.ts index 9a9aa0df..532a3143 100644 --- a/src/components/shared/Panel.styles.ts +++ b/src/components/shared/Panel.styles.ts @@ -2,7 +2,7 @@ import { FontSizes, ITheme } from '@chili-publish/grafx-shared-components'; import styled from 'styled-components'; export const PanelTitle = styled.h2<{ margin?: string; panelTheme: ITheme['panel'] }>` - font-size: ${FontSizes.heading2}; + font-size: ${FontSizes.header}; font-weight: 500; ${(props) => props.margin && `margin: ${props.margin};`}; color: ${(props) => props.panelTheme.color}; diff --git a/src/components/variables/VariablesPanel.styles.ts b/src/components/variables/VariablesPanel.styles.ts index 75328ac3..04dbb8a8 100644 --- a/src/components/variables/VariablesPanel.styles.ts +++ b/src/components/variables/VariablesPanel.styles.ts @@ -12,7 +12,7 @@ export const VariablesContainer = styled.div<{ height?: string }>` height: ${(props) => props.height ?? '100%'}; `; export const TrayPanelTitle = styled.h2<{ margin?: string; panelTheme: ITheme['panel'] }>` - font-size: ${FontSizes.heading2}; + font-size: ${FontSizes.header}; font-weight: 500; ${(props) => props.margin && `margin: ${props.margin};`}; color: ${(props) => props.panelTheme.color}; diff --git a/src/tests/components/variablesComponents/imageVariable/useMediaDetails.test.ts b/src/tests/components/variablesComponents/imageVariable/useMediaDetails.test.ts index 19088340..ef4b2800 100644 --- a/src/tests/components/variablesComponents/imageVariable/useMediaDetails.test.ts +++ b/src/tests/components/variablesComponents/imageVariable/useMediaDetails.test.ts @@ -1,9 +1,9 @@ +import { ConnectorMappingDirection, Variable } from '@chili-publish/studio-sdk'; import { renderHook, waitFor } from '@testing-library/react'; import { act } from 'react-dom/test-utils'; -import { ConnectorMappingDirection, Variable } from '@chili-publish/studio-sdk'; import { useMediaDetails } from '../../../../components/variablesComponents/imageVariable/useMediaDetails'; -import { useVariablePanelContext } from '../../../../contexts/VariablePanelContext'; import { useSubscriberContext } from '../../../../contexts/Subscriber'; +import { useVariablePanelContext } from '../../../../contexts/VariablePanelContext'; import { Subscriber } from '../../../../utils/subscriber'; jest.mock('../../../../contexts/VariablePanelContext', () => ({ @@ -155,7 +155,7 @@ describe('"useMediaDetails" hook', () => { const variableChange = { id: '7377E97A-5FD9-46B1-A8CF-0C7C776C7DC2', value: '1234' } as unknown as Variable; mockSubscriber.emit('onVariableListChanged', [variableChange]); - await act(() => { + await waitFor(() => { expect(window.StudioUISDK.mediaConnector.query).toHaveBeenCalledTimes(1); }); }); @@ -181,7 +181,7 @@ describe('"useMediaDetails" hook', () => { const variableChange = { id: '2', value: '1234' } as unknown as Variable; mockSubscriber.emit('onVariableListChanged', [variableChange]); - await act(() => { + await waitFor(() => { expect(window.StudioUISDK.mediaConnector.query).toHaveBeenCalledTimes(1); }); }); @@ -207,7 +207,7 @@ describe('"useMediaDetails" hook', () => { const variableChange = { id: '8A59BB89-898D-4BAC-9C8F-F40F6C83479E', value: '1234' } as unknown as Variable; mockSubscriber.emit('onVariableListChanged', [variableChange]); - await act(() => { + await waitFor(() => { expect(window.StudioUISDK.mediaConnector.query).not.toHaveBeenCalled(); expect(result.current).toEqual(null); }); @@ -248,7 +248,7 @@ describe('"useMediaDetails" hook', () => { expect(window.StudioUISDK.mediaConnector.query).toHaveBeenCalledTimes(2); - await act(() => { + await waitFor(() => { expect(result.current).toEqual(null); }); }); @@ -288,7 +288,7 @@ describe('"useMediaDetails" hook', () => { expect(window.StudioUISDK.mediaConnector.query).toHaveBeenCalledTimes(2); - await act(() => { + await waitFor(() => { expect(result.current).toEqual({ id: 'media', name: 'name', @@ -320,7 +320,7 @@ describe('"useMediaDetails" hook', () => { expect(window.StudioUISDK.mediaConnector.query).toHaveBeenCalledWith('grafx-media', {}, {}), ); - await act(() => { + await waitFor(() => { expect(result.current).toEqual({ id: 'media', name: 'name', diff --git a/yarn.lock b/yarn.lock index 0007044e..114531ed 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1307,10 +1307,10 @@ resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39" integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw== -"@chili-publish/grafx-shared-components@^0.88.5": - version "0.88.5" - resolved "https://npm.pkg.github.com/download/@chili-publish/grafx-shared-components/0.88.5/aa968330c77f12967edc411be95b22d8e5d8db32#aa968330c77f12967edc411be95b22d8e5d8db32" - integrity sha512-zYxlrDmrG/zRTjjJ6rEy4vyd0b4rK6EilTTokjq7XE2P9xS0lb3GuYSgIwrTEC37ptOaZladwOpo/NNl17F0rw== +"@chili-publish/grafx-shared-components@^0.88.7": + version "0.88.7" + resolved "https://npm.pkg.github.com/download/@chili-publish/grafx-shared-components/0.88.7/45252dbd33710f882c1aaf10261388490fc1d74c#45252dbd33710f882c1aaf10261388490fc1d74c" + integrity sha512-zTI0QC4UevhkkHvKnfpSFjGYpb7fwd3Fd340CmRJ1zCTWqjmpgijgLy/guotXlGqlXMabEwf4dlaqu8Sg+J4Ew== "@chili-publish/studio-sdk@^1.17.2-rc.1": version "1.17.2-rc.1"