Skip to content

Commit 551ca5d

Browse files
committed
frontend: remove snapshot testing
The tests have two snapshots that were introduced a long time ago these were never particularly useful in the past. Removing as minor markup changes do not help with testing. Introduced in: - 25c219c - 8ff4909
1 parent 2379b9e commit 551ca5d

File tree

5 files changed

+1
-156
lines changed

5 files changed

+1
-156
lines changed

frontends/web/src/components/message/__snapshots__/message.test.tsx.snap

Lines changed: 0 additions & 19 deletions
This file was deleted.

frontends/web/src/components/message/message.test.tsx

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,6 @@ import { Message } from './message';
2020
import '@testing-library/jest-dom'; // TODO needed?
2121

2222
describe('components/message/message', () => {
23-
it('should have child nodes', () => {
24-
const msg = render(<Message><span>hello</span></Message>);
25-
expect(msg.container.firstChild!).toMatchSnapshot();
26-
});
2723

2824
it('should return return null', () => {
2925
const msg = render(<Message hidden><span>hello</span></Message>);

frontends/web/src/components/message/message.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ export const Message = ({
7575
<div className={`
7676
${styles[type] || ''}
7777
${small && styles.small || ''}
78-
`}>
78+
`.trim()}>
7979
{!noIcon && <MessageIcon type={type} icon={icon} />}
8080
<div className={styles.content}>
8181
{title && (

frontends/web/src/routes/account/send/__snapshots__/feetargets.test.tsx.snap

Lines changed: 0 additions & 59 deletions
This file was deleted.

frontends/web/src/routes/account/send/feetargets.test.tsx

Lines changed: 0 additions & 73 deletions
Original file line numberDiff line numberDiff line change
@@ -35,79 +35,6 @@ vi.mock('@/hooks/mediaquery', () => ({
3535

3636
describe('routes/account/send/feetargets', () => {
3737

38-
it('should match the snapshot', async () => {
39-
getConfig.mockReturnValue(Promise.resolve({
40-
frontend: { expertFee: false }
41-
}));
42-
(apiGet as Mock).mockResolvedValue({
43-
defaultFeeTarget: 'economy',
44-
feeTargets: [
45-
{ code: 'low' },
46-
{ code: 'economy' },
47-
],
48-
});
49-
50-
const { container } = render(
51-
<FeeTargets
52-
accountCode="btc"
53-
coinCode="btc"
54-
disabled={false}
55-
fiatUnit="USD"
56-
proposedFee={{
57-
amount: '1',
58-
estimated: false,
59-
unit: 'ETH',
60-
conversions: {
61-
AUD: '0.02',
62-
BRL: '12900',
63-
CAD: '0.02',
64-
CHF: '0.01',
65-
CNY: '0.08',
66-
CZK: '0.06',
67-
EUR: '0.02',
68-
GBP: '0.02',
69-
HKD: '19880',
70-
NOK: '0.02',
71-
NZD: '0.02',
72-
ILS: '0.02',
73-
JPY: '1.30',
74-
KRW: '14.43',
75-
PLN: '2',
76-
RUB: '0.88',
77-
SEK: '0.1',
78-
SGD: '32233',
79-
USD: '0.02',
80-
BTC: '0.02',
81-
sat: '2000000',
82-
},
83-
}}
84-
customFee=""
85-
onCustomFee={vi.fn()}
86-
onFeeTargetChange={vi.fn()} />,
87-
);
88-
waitFor(() => expect(container).toMatchSnapshot());
89-
});
90-
91-
it('should match the snapshot with empty feetargets', async () => {
92-
getConfig.mockReturnValue(Promise.resolve({ frontend: { expertFee: false } }));
93-
(apiGet as Mock).mockResolvedValue({
94-
defaultFeeTarget: '',
95-
feeTargets: [],
96-
});
97-
98-
const { container } = render(
99-
<FeeTargets
100-
accountCode="eth"
101-
coinCode="eth"
102-
disabled={false}
103-
fiatUnit="EUR"
104-
customFee=""
105-
onCustomFee={vi.fn()}
106-
onFeeTargetChange={vi.fn()} />,
107-
);
108-
await waitFor(() => expect(container).toMatchSnapshot());
109-
});
110-
11138
it('should call onFeeTargetChange with default', () => new Promise<void>(async done => {
11239
getConfig.mockReturnValue(Promise.resolve({ frontend: { expertFee: false } }));
11340
const apiGetMock = (apiGet as Mock).mockResolvedValue({

0 commit comments

Comments
 (0)