Files
react-native/Libraries/LogBox/UI/__tests__/LogBoxInspectorSourceMapStatus-test.js
T
Rick Hanlon 8524b6182d LogBox - Optimistically symbolicate
Summary:
This diff adds optimistic loading for symbolicated stack traces by so that we (almost) never show a loading state for stack traces. Because of this, we also remove the "Stack Trace" status except when it is loading or failed. Also refactored the related components to hooks 🎣

Changelog: [Internal]

Reviewed By: mmmulani

Differential Revision: D18110403

fbshipit-source-id: a93b0a63e1c9490fea73ca6ec7c5707670bdea53
2019-10-31 16:26:42 -07:00

44 lines
1.1 KiB
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 LogBoxInspectorSourceMapStatus = require('../LogBoxInspectorSourceMapStatus')
.default;
const render = require('../../../../jest/renderer');
describe('LogBoxInspectorSourceMapStatus', () => {
it('should render for failed', () => {
const output = render.shallowRender(
<LogBoxInspectorSourceMapStatus onPress={() => {}} status="FAILED" />,
);
expect(output).toMatchSnapshot();
});
it('should render for pending', () => {
const output = render.shallowRender(
<LogBoxInspectorSourceMapStatus onPress={() => {}} status="PENDING" />,
);
expect(output).toMatchSnapshot();
});
it('should render null for complete', () => {
const output = render.shallowRender(
<LogBoxInspectorSourceMapStatus onPress={() => {}} status="COMPLETE" />,
);
expect(output).toMatchSnapshot();
});
});