mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
c5aa26da41
Summary: This diff adds a level to LogBox logs so that we can store and display errors in later diffs Changelog: [Internal] Reviewed By: cpojer Differential Revision: D18091101 fbshipit-source-id: 21661d28a7945bdcb56702e2a03ab3612c11fe35
46 lines
1000 B
JavaScript
46 lines
1000 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(
|
|
'warn',
|
|
{
|
|
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();
|
|
});
|
|
});
|