Skip to content

Commit

Permalink
Fix lint
Browse files Browse the repository at this point in the history
  • Loading branch information
FrederikBolding committed Feb 4, 2025
1 parent 43bb49c commit 8ce28bc
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 8 deletions.
18 changes: 11 additions & 7 deletions ui/components/app/snaps/snap-ui-renderer/snap-ui-renderer.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ import {
Input,
} from '@metamask/snaps-sdk/jsx';
import configureMockStore from 'redux-mock-store';
import mockState from '../../../../../test/data/mock-state.json';
import { renderWithProvider } from '../../../../../test/lib/render-helpers';
import { SnapUIRenderer } from './snap-ui-renderer';
import { fireEvent } from '@testing-library/react';
import thunk from 'redux-thunk';
import { renderWithProvider } from '../../../../../test/lib/render-helpers';
import mockState from '../../../../../test/data/mock-state.json';
import * as backgroundConnection from '../../../../store/background-connection';
import { BackgroundColor } from '../../../../helpers/constants/design-system';
import { SnapUIRenderer } from './snap-ui-renderer';

jest.mock('../../../../store/background-connection', () => ({
...jest.requireActual('../../../../store/background-connection'),
Expand Down Expand Up @@ -67,7 +67,7 @@ describe('SnapUIRenderer', () => {
it('renders loading state', () => {
const { container } = renderInterface(null);

expect(container.getElementsByClassName('pulse-loader').length).toBe(1);
expect(container.getElementsByClassName('pulse-loader')).toHaveLength(1);
expect(container).toMatchSnapshot();
});

Expand Down Expand Up @@ -116,7 +116,7 @@ describe('SnapUIRenderer', () => {
});

it('supports the contentBackgroundColor prop', () => {
const { container, getByText } = renderInterface(
const { container } = renderInterface(
Container({
children: [
Box({ children: Text({ children: 'Hello world!' }) }),
Expand All @@ -129,12 +129,16 @@ describe('SnapUIRenderer', () => {
},
);

expect(container.getElementsByClassName('mm-box--background-color-background-alternative').length).toBe(1);
expect(
container.getElementsByClassName(
'mm-box--background-color-background-alternative',
),
).toHaveLength(1);
expect(container).toMatchSnapshot();
});

it('supports interactive inputs', () => {
const { container, getByText, getByRole } = renderInterface(
const { container, getByRole } = renderInterface(
Container({
children: [
Box({ children: Input({ name: 'input' }) }),
Expand Down
2 changes: 1 addition & 1 deletion ui/components/app/snaps/snap-ui-renderer/utils.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { JSXElementStruct, Box, Text } from '@metamask/snaps-sdk/jsx';
import { JSXElementStruct } from '@metamask/snaps-sdk/jsx';
import { COMPONENT_MAPPING } from './components';

const EXCLUDED_COMPONENTS = ['Option', 'Radio', 'SelectorOption'];
Expand Down

0 comments on commit 8ce28bc

Please sign in to comment.