redux-devtools/packages/redux-devtools-inspector-monitor-trace-tab/test/StackTraceTab.spec.tsx
Nathan Bierema b82de74592
Add ESM builds (#997)
* Use rollup for d3tooltip

* Use rollup for map2tree

* Set moduleResolution

* Use rollup for d3-state-visualizer

* Use rollup for react-base16-styling

* Use rollup for react-dock

* Use rollup for react-json-tree

* Use rollup for redux-devtools

* Use rollup for redux-devtools-intrument

* Use rollup for redux-devtools-chart-monitor

* Update export

* Use rollup for redux-devtools-dock-monitor

* Use rollup for redux-devtools-inspector-monitor

* Fix inspector demo

* Fix invalid eslint config

* Use rollup for inspector-monitor-test-tab

* Use rollup for inspector-monitor-trace-tab

* Use rollup for redux-devtools-log-monitor

* Use rollup for redux-devtools-remote

* Use rollup in redux-devtools-rtk-query-monitor

* Use rollup for redux-devtools-serialize

* Fix redux-devtools examples

* Use rollup for redux-devtools-slider-monitor

* Fix slider examples

* Use rollup for redux-devtools-ui

* Use rollup for redux-devtools-utils

* Use rollup for redux-devtools-extension

* Use rollup for redux-devtools-app

* Fix Webpack app build

* Fix extension build

* Turn on minimization

* Update CLI
2022-01-10 15:41:53 +00:00

49 lines
1.6 KiB
TypeScript

import React from 'react';
import { render, screen } from '@testing-library/react';
import { TraceTab } from '../src/StackTraceTab';
const actions = {
0: { type: 'PERFORM_ACTION', action: { type: '@@INIT' } },
1: { type: 'PERFORM_ACTION', action: { type: 'INCREMENT_COUNTER' } },
2: {
type: 'PERFORM_ACTION',
action: { type: 'INCREMENT_COUNTER' },
stack:
'Error\n at fn1 (app.js:72:24)\n at fn2 (app.js:84:31)\n ' +
'at fn3 (chrome-extension://lmhkpmbekcpmknklioeibfkpmmfibljd/js/page.bundle.js:1269:80)',
},
};
const TraceTabAsAny = TraceTab as any;
describe('StackTraceTab component', () => {
it('should render with no props', async () => {
const { container } = render(<TraceTabAsAny />);
await screen.findByTestId('stack-trace');
expect(container.firstChild).toMatchSnapshot();
});
it('should render with props, but without stack', async () => {
const { container } = render(
<TraceTabAsAny actions={actions} action={actions[0].action} />
);
await screen.findByTestId('stack-trace');
expect(container.firstChild).toMatchSnapshot();
});
it('should render the link to docs', () => {
const { container } = render(
<TraceTabAsAny actions={actions} action={actions[1].action} />
);
expect(container.firstChild).toMatchSnapshot();
});
it('should render with trace stack', async () => {
const { container } = render(
<TraceTabAsAny actions={actions} action={actions[2].action} />
);
await screen.findByTestId('stack-trace');
expect(container.firstChild).toMatchSnapshot();
});
});