From 67f24481230ddda652388bdacf9358016078a762 Mon Sep 17 00:00:00 2001 From: Maxim Khvatalin Date: Mon, 24 Jun 2024 22:27:25 +0300 Subject: [PATCH] feat: spin settings button during settings loading --- .../hooks/createSettingsDialog.tsx | 8 +-- src/components/Footer/Footer.test.tsx | 8 ++- .../SettingsButton/SettingsButton.test.tsx | 53 ++++++++++++++- .../SettingsButton.test.tsx.snap | 1 + src/components/SettingsButton/index.tsx | 67 ++++++++++++++----- src/components/SettingsButton/styles.ts | 19 +++++- src/components/SettingsDialog/index.tsx | 8 ++- 7 files changed, 136 insertions(+), 28 deletions(-) diff --git a/src/components/Application/hooks/createSettingsDialog.tsx b/src/components/Application/hooks/createSettingsDialog.tsx index 6840969..d0af2cd 100644 --- a/src/components/Application/hooks/createSettingsDialog.tsx +++ b/src/components/Application/hooks/createSettingsDialog.tsx @@ -25,11 +25,11 @@ export default function createSettingsDialog(): CreateSettingsDialogReturnValue return { $el: ( - - + + - - + + ), open: handleSettingsRequest, } diff --git a/src/components/Footer/Footer.test.tsx b/src/components/Footer/Footer.test.tsx index 0d92b29..6505693 100644 --- a/src/components/Footer/Footer.test.tsx +++ b/src/components/Footer/Footer.test.tsx @@ -1,4 +1,4 @@ -import { fireEvent, render, screen } from '@test/helpers/solid' +import { fireEvent, render, screen, waitFor } from '@test/helpers/solid' import Footer from '.' vi.mock('@/components/Credits', () => ({ @@ -6,7 +6,7 @@ vi.mock('@/components/Credits', () => ({ })) describe('Footer', () => { - it('renders a settings button', () => { + it('renders a settings button', async () => { const handleSettingsRequest = vi.fn() render(() =>