test: add ErrorView testcase

pull/105/merge
moonrailgun 2 years ago
parent 819adc860d
commit 98632cd530

@ -1,5 +1,5 @@
import type React from 'react';
import create from 'zustand';
import { create } from 'zustand';
import { immer } from 'zustand/middleware/immer';
interface ElementDisplayRect {

@ -0,0 +1,10 @@
import { render } from '@testing-library/react';
import React from 'react';
import { ErrorView } from '../ErrorView';
describe('ErrorView', () => {
test('render', () => {
const wrapper = render(<ErrorView error={new Error('Dummy Error')} />);
expect(wrapper.container).toMatchSnapshot();
});
});

@ -0,0 +1,17 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`ErrorView render 1`] = `
<div>
<div
class="text-center w-full"
>
<img
class="w-32 h-32 m-auto mb-2"
src="problem.svg"
/>
<div>
Dummy Error
</div>
</div>
</div>
`;
Loading…
Cancel
Save