Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,24 @@ const {
} = require('../LogBoxNotificationContainer');
const React = require('react');

// Mock `LogBoxLogNotification` because we are interested in snapshotting the
// behavior of `LogBoxNotificationContainer`, not `LogBoxLogNotification`.
jest.mock('../UI/LogBoxNotification', () => ({
__esModule: true,
default: 'LogBoxLogNotification',
}));

describe('LogBoxNotificationContainer', () => {
it('should render null with no logs', () => {
const output = render.shallowRender(
const output = render.create(
<LogBoxNotificationContainer selectedLogIndex={-1} logs={[]} />,
);

expect(output).toMatchSnapshot();
});

it('should render null with no selected log and disabled', () => {
const output = render.shallowRender(
const output = render.create(
<LogBoxNotificationContainer
isDisabled
selectedLogIndex={-1}
Expand All @@ -52,7 +59,7 @@ describe('LogBoxNotificationContainer', () => {
});

it('should render the latest warning notification', () => {
const output = render.shallowRender(
const output = render.create(
<LogBoxNotificationContainer
selectedLogIndex={-1}
logs={[
Expand Down Expand Up @@ -86,7 +93,7 @@ describe('LogBoxNotificationContainer', () => {
});

it('should render the latest error notification', () => {
const output = render.shallowRender(
const output = render.create(
<LogBoxNotificationContainer
selectedLogIndex={-1}
logs={[
Expand Down Expand Up @@ -120,7 +127,7 @@ describe('LogBoxNotificationContainer', () => {
});

it('should render both an error and warning notification', () => {
const output = render.shallowRender(
const output = render.create(
<LogBoxNotificationContainer
selectedLogIndex={-1}
logs={[
Expand Down Expand Up @@ -154,7 +161,7 @@ describe('LogBoxNotificationContainer', () => {
});

it('should render selected fatal error even when disabled', () => {
const output = render.shallowRender(
const output = render.create(
<LogBoxNotificationContainer
isDisabled
selectedLogIndex={0}
Expand All @@ -178,7 +185,7 @@ describe('LogBoxNotificationContainer', () => {
});

it('should render selected syntax error even when disabled', () => {
const output = render.shallowRender(
const output = render.create(
<LogBoxNotificationContainer
isDisabled
selectedLogIndex={0}
Expand Down