From a2fcd2e1d55c121a55818503b3703b8c74ef70e2 Mon Sep 17 00:00:00 2001 From: hustlernik Date: Thu, 26 Dec 2024 18:53:38 +0530 Subject: [PATCH 1/2] refactor: jest to vitest migration for EditCustomFieldDropDown.test.tsx --- ...pDown.test.tsx => EditCustomFieldDropDown.spec.tsx} | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) rename src/components/EditCustomFieldDropDown/{EditCustomFieldDropDown.test.tsx => EditCustomFieldDropDown.spec.tsx} (90%) diff --git a/src/components/EditCustomFieldDropDown/EditCustomFieldDropDown.test.tsx b/src/components/EditCustomFieldDropDown/EditCustomFieldDropDown.spec.tsx similarity index 90% rename from src/components/EditCustomFieldDropDown/EditCustomFieldDropDown.test.tsx rename to src/components/EditCustomFieldDropDown/EditCustomFieldDropDown.spec.tsx index 19d2249a43..4119800dd1 100644 --- a/src/components/EditCustomFieldDropDown/EditCustomFieldDropDown.test.tsx +++ b/src/components/EditCustomFieldDropDown/EditCustomFieldDropDown.spec.tsx @@ -8,6 +8,7 @@ import availableFieldTypes from 'utils/fieldTypes'; import { I18nextProvider } from 'react-i18next'; import i18nForTest from 'utils/i18nForTest'; import type { InterfaceCustomFieldData } from 'utils/interfaces'; +import { describe, it, expect } from 'vitest'; async function wait(ms = 100): Promise { await act(() => { @@ -18,7 +19,7 @@ async function wait(ms = 100): Promise { } describe('Testing Custom Field Dropdown', () => { - test('Component Should be rendered properly', async () => { + it('Component Should be rendered properly', async () => { const customFieldData = { type: 'Number', name: 'Age', @@ -26,11 +27,10 @@ describe('Testing Custom Field Dropdown', () => { const setCustomFieldData: Dispatch< SetStateAction - > = (val) => { - { - val; - } + > = () => { + // Intentionally left blank for testing purposes }; + const props = { customFieldData: customFieldData as InterfaceCustomFieldData, setCustomFieldData: setCustomFieldData, From 278b6825b870e1197f5c303b505ec6519d4debed Mon Sep 17 00:00:00 2001 From: hustlernik Date: Thu, 26 Dec 2024 19:41:15 +0530 Subject: [PATCH 2/2] refactor css for AddOnEntry.tsx --- .../core/AddOnEntry/AddOnEntry.module.css | 24 ----------------- .../AddOn/core/AddOnEntry/AddOnEntry.tsx | 2 +- src/style/app.module.css | 27 +++++++++++++++++++ 3 files changed, 28 insertions(+), 25 deletions(-) delete mode 100644 src/components/AddOn/core/AddOnEntry/AddOnEntry.module.css diff --git a/src/components/AddOn/core/AddOnEntry/AddOnEntry.module.css b/src/components/AddOn/core/AddOnEntry/AddOnEntry.module.css deleted file mode 100644 index c5dd86c8d4..0000000000 --- a/src/components/AddOn/core/AddOnEntry/AddOnEntry.module.css +++ /dev/null @@ -1,24 +0,0 @@ -.entrytoggle { - margin: 24px 24px 0 auto; - width: fit-content; -} - -.entryaction { - margin-left: auto; - display: flex !important; - align-items: center; - background-color: transparent; - color: #31bb6b; -} -.card { - border: 4px solid green; -} -.entryaction i { - margin-right: 8px; -} - -.entryaction .spinner-grow { - height: 1rem; - width: 1rem; - margin-right: 8px; -} diff --git a/src/components/AddOn/core/AddOnEntry/AddOnEntry.tsx b/src/components/AddOn/core/AddOnEntry/AddOnEntry.tsx index 12805568f6..e2971fee14 100644 --- a/src/components/AddOn/core/AddOnEntry/AddOnEntry.tsx +++ b/src/components/AddOn/core/AddOnEntry/AddOnEntry.tsx @@ -1,5 +1,5 @@ import React, { useState } from 'react'; -import styles from './AddOnEntry.module.css'; +import styles from './../../../../style/app.module.css'; import { Button, Card, Spinner } from 'react-bootstrap'; import { UPDATE_INSTALL_STATUS_PLUGIN_MUTATION } from 'GraphQl/Mutations/mutations'; import { useMutation } from '@apollo/client'; diff --git a/src/style/app.module.css b/src/style/app.module.css index 3bc46315f9..6329ead1a4 100644 --- a/src/style/app.module.css +++ b/src/style/app.module.css @@ -2302,3 +2302,30 @@ button[data-testid='createPostBtn'] { transform: scale(1); } } + +/* AddOnEntry.tsx */ + +.entrytoggle { + margin: 24px 24px 0 auto; + width: fit-content; +} + +.entryaction { + margin-left: auto; + display: flex !important; + align-items: center; + background-color: transparent; + color: #31bb6b; +} +.cardAddOnEntry { + border: 4px solid green; +} +.entryaction i { + margin-right: 8px; +} + +.entryaction .spinner-grow { + height: 1rem; + width: 1rem; + margin-right: 8px; +}