Files
react-native/Libraries/LogBox/UI/__tests__/LogBoxLogNotification-test.js
T
Rick Hanlon c55aa1dd8c LogBox - Change count from grouping number to total count
Summary:
Previously we were should the count for the group (similar to how Chrome show the count on logs). This makes it difficult (impossible) to know how many logs are in the console without opening up the inspector.

This diff changes it so that the count shows the total number of warnings in the console instead.

Changelog: [Internal]

Reviewed By: cpojer

Differential Revision: D18056028

fbshipit-source-id: c94a446708fb0885962e5c7dde75300cbedbab9b
2019-10-22 14:13:19 -07:00

45 lines
990 B
JavaScript

/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @format
* @emails oncall+react_native
* @flow
*/
'use strict';
const React = require('react');
const LogBoxLogNotification = require('../LogBoxLogNotification').default;
const LogBoxLog = require('../../Data/LogBoxLog').default;
const render = require('../../../../jest/renderer');
const log = new LogBoxLog(
{
content: 'Some kind of message',
substitutions: [],
},
[],
'Some kind of message',
[],
);
describe('LogBoxLogNotification', () => {
it('should render log', () => {
const output = render.shallowRender(
<LogBoxLogNotification
log={log}
totalLogCount={1}
level="warn"
onPressOpen={() => {}}
onPressList={() => {}}
onPressDismiss={() => {}}
/>,
);
expect(output).toMatchSnapshot();
});
});