mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
8524b6182d
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
44 lines
1.1 KiB
JavaScript
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();
|
|
});
|
|
});
|