Skip to content

Commit

Permalink
feat: fix tests and linting
Browse files Browse the repository at this point in the history
  • Loading branch information
BLuEScioN committed Jan 17, 2025
1 parent 886f585 commit 5853d82
Showing 4 changed files with 9 additions and 7 deletions.
4 changes: 3 additions & 1 deletion src/app/sandbox/deploy/LeftSection.tsx
Original file line number Diff line number Diff line change
@@ -72,7 +72,9 @@ export function LeftSection() {
>
<Input
value={contractName}
onChange={(e: any) => setContractName(e.target?.value as string)}
onChange={(e: React.ChangeEvent<HTMLInputElement>) =>
setContractName(e.target?.value)

Check warning on line 76 in src/app/sandbox/deploy/LeftSection.tsx

Codecov / codecov/patch

src/app/sandbox/deploy/LeftSection.tsx#L76

Added line #L76 was not covered by tests
}
placeholder="Name your contract"
pr={21}
w="full"
2 changes: 1 addition & 1 deletion src/app/txid/[txId]/TxDetails/__tests__/Broadcast.test.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { renderWithChakraProviders } from '@/common/utils/test-utils/render-utils';
import '@testing-library/jest-dom/extend-expect';

import { Transaction } from '@stacks/stacks-blockchain-api-types';

import '../../../../../common/utils/test-utils/matchMedia.mock';
import { Broadcast } from '../Broadcast';
import { renderWithChakraProviders } from '@/common/utils/test-utils/render-utils';

describe('<Broadcast />', () => {
it('renders correctly', () => {
Original file line number Diff line number Diff line change
@@ -79,7 +79,7 @@ exports[`<Broadcast /> renders correctly 1`] = `
style="top: 0px; left: 0px; width: 100%; height: 100%; position: absolute; z-index: inherit;"
/>
</div>
6:00:00 AM 1/1/2023
12:00:00 PM 1/1/2023
</div>
</div>
</div>
8 changes: 4 additions & 4 deletions src/common/utils/test-utils/render-utils.tsx
Original file line number Diff line number Diff line change
@@ -116,7 +116,6 @@ export function ReduxProvider({ children, store }: ProvidersProps) {
return <Provider store={store ?? createDefaultStore()}>{children}</Provider>;
}


export function renderWithReduxProviders(

Check warning on line 119 in src/common/utils/test-utils/render-utils.tsx

Codecov / codecov/patch

src/common/utils/test-utils/render-utils.tsx#L119

Added line #L119 was not covered by tests
ui: React.ReactElement,
{
@@ -149,7 +148,6 @@ export function renderWithReduxProviders(
return { store, ...render(ui, { wrapper: Wrapper, ...renderOptions }) };

Check warning on line 148 in src/common/utils/test-utils/render-utils.tsx

Codecov / codecov/patch

src/common/utils/test-utils/render-utils.tsx#L148

Added line #L148 was not covered by tests
}


export function QueryProvider({ children, queryClient }: ProvidersProps) {

Check warning on line 151 in src/common/utils/test-utils/render-utils.tsx

Codecov / codecov/patch

src/common/utils/test-utils/render-utils.tsx#L151

Added line #L151 was not covered by tests
return (
<QueryClientProvider client={queryClient ?? createDefaultQueryClient()}>
@@ -162,5 +160,7 @@ export function ChakraProviderWrapper({ children }: { children: React.ReactNode
return <ChakraProvider value={system}>{children}</ChakraProvider>;
}

export const renderWithChakraProviders = (ui: ReactElement, options?: Omit<RenderOptions, 'wrapper'>) =>
render(ui, { wrapper: ChakraProviderWrapper, ...options });
export const renderWithChakraProviders = (
ui: ReactElement,
options?: Omit<RenderOptions, 'wrapper'>
) => render(ui, { wrapper: ChakraProviderWrapper, ...options });

0 comments on commit 5853d82

Please sign in to comment.