This commit is contained in:
Norbert de Langen 2022-10-28 14:31:44 +02:00
parent 4b63eec847
commit 6cfe8494ba
No known key found for this signature in database
GPG Key ID: FD0E78AF9A837762

View File

@ -15,6 +15,7 @@ import {
import { start as realStart } from './start';
jest.mock('global', () => ({
// @ts-expect-error (jest is not happy with this)
...jest.requireActual('global'),
history: { replaceState: jest.fn() },
document: {
@ -121,7 +122,6 @@ describe('start', () => {
await waitForRender();
// @ts-expect-error (mockChannel be like that)
expect(mockChannel.emit.mock.calls.find((call: [string, any]) => call[0] === SET_INDEX)[1])
.toMatchInlineSnapshot(`
Object {
@ -277,7 +277,6 @@ describe('start', () => {
await waitForRender();
expect(mockChannel.emit).toHaveBeenCalledWith(STORY_RENDERED, 'component-a--default');
// @ts-expect-error (mockChannel be like that)
const storiesOfData = mockChannel.emit.mock.calls.find(
(call: any[]) => call[0] === SET_INDEX
)[1];
@ -411,7 +410,6 @@ describe('start', () => {
.add('new', jest.fn());
await waitForEvents([SET_INDEX]);
// @ts-expect-error (mockChannel be like that)
expect(mockChannel.emit.mock.calls.find((call: [string, any]) => call[0] === SET_INDEX)[1])
.toMatchInlineSnapshot(`
Object {
@ -483,7 +481,6 @@ describe('start', () => {
});
await waitForEvents([SET_INDEX]);
// @ts-expect-error (mockChannel be like that)
expect(mockChannel.emit.mock.calls.find((call: [string, any]) => call[0] === SET_INDEX)[1])
.toMatchInlineSnapshot(`
Object {
@ -536,7 +533,6 @@ describe('start', () => {
disposeCallback();
await waitForEvents([SET_INDEX]);
// @ts-expect-error (mockChannel be like that)
expect(mockChannel.emit.mock.calls.find((call: [string, any]) => call[0] === SET_INDEX)[1])
.toMatchInlineSnapshot(`
Object {
@ -588,7 +584,6 @@ describe('start', () => {
configure('test', () => [componentCExports]);
await waitForRender();
// @ts-expect-error (mockChannel be like that)
expect(mockChannel.emit.mock.calls.find((call: [string, any]) => call[0] === SET_INDEX)[1])
.toMatchInlineSnapshot(`
Object {
@ -710,7 +705,6 @@ describe('start', () => {
configure('test', () => [{ ...componentCExports, StoryThree: jest.fn() }], module as any);
await waitForEvents([SET_INDEX]);
// @ts-expect-error (mockChannel be like that)
expect(mockChannel.emit.mock.calls.find((call: [string, any]) => call[0] === SET_INDEX)[1])
.toMatchInlineSnapshot(`
Object {
@ -802,7 +796,6 @@ describe('start', () => {
);
await waitForEvents([SET_INDEX]);
// @ts-expect-error (mockChannel be like that)
expect(mockChannel.emit.mock.calls.find((call: [string, any]) => call[0] === SET_INDEX)[1])
.toMatchInlineSnapshot(`
Object {
@ -875,7 +868,6 @@ describe('start', () => {
configure('test', () => [componentCExports], module as any);
await waitForEvents([SET_INDEX]);
// @ts-expect-error (mockChannel be like that)
expect(mockChannel.emit.mock.calls.find((call: [string, any]) => call[0] === SET_INDEX)[1])
.toMatchInlineSnapshot(`
Object {
@ -976,7 +968,6 @@ describe('start', () => {
);
await waitForEvents([SET_INDEX]);
// @ts-expect-error (mockChannel be like that)
expect(mockChannel.emit.mock.calls.find((call: [string, any]) => call[0] === SET_INDEX)[1])
.toMatchInlineSnapshot(`
Object {
@ -1023,7 +1014,6 @@ describe('start', () => {
});
await waitForRender();
// @ts-expect-error (mockChannel be like that)
expect(mockChannel.emit.mock.calls.find((call: [string, any]) => call[0] === SET_INDEX)[1])
.toMatchInlineSnapshot(`
Object {
@ -1167,7 +1157,6 @@ describe('start', () => {
});
await waitForRender();
// @ts-expect-error (mockChannel be like that)
expect(mockChannel.emit.mock.calls.find((call: [string, any]) => call[0] === SET_INDEX)[1])
.toMatchInlineSnapshot(`
Object {
@ -1322,7 +1311,6 @@ describe('start', () => {
configure('test', () => [componentDExports]);
await waitForEvents([SET_INDEX]);
// @ts-expect-error (mockChannel be like that)
expect(mockChannel.emit.mock.calls.find((call: [string, any]) => call[0] === SET_INDEX)[1])
.toMatchInlineSnapshot(`
Object {