Add basic TitleBar test
Summary: Manually checked that the snapshot doesn't contain the auto updater. Reviewed By: jknoxville Differential Revision: D13715520 fbshipit-source-id: 720fed1e9952b788bce3311ecb508cfcfdc1758a
This commit is contained in:
committed by
Facebook Github Bot
parent
dfe956ab39
commit
51ab27456a
31
src/chrome/__tests__/TitleBar.electron.js
Normal file
31
src/chrome/__tests__/TitleBar.electron.js
Normal file
@@ -0,0 +1,31 @@
|
|||||||
|
/**
|
||||||
|
* Copyright 2018-present Facebook.
|
||||||
|
* This source code is licensed under the MIT license found in the
|
||||||
|
* LICENSE file in the root directory of this source tree.
|
||||||
|
* @format
|
||||||
|
*/
|
||||||
|
|
||||||
|
import TitleBar from '../TitleBar.js';
|
||||||
|
import renderer from 'react-test-renderer';
|
||||||
|
import reducers from '../../reducers/index.js';
|
||||||
|
import configureStore from 'redux-mock-store';
|
||||||
|
import {Provider} from 'react-redux';
|
||||||
|
|
||||||
|
const mockStore = configureStore([])(reducers(undefined, {type: 'INIT'}));
|
||||||
|
|
||||||
|
test('TitleBar is rendered', () => {
|
||||||
|
const component = renderer.create(
|
||||||
|
<Provider store={mockStore}>
|
||||||
|
<TitleBar
|
||||||
|
windowIsFocused={true}
|
||||||
|
leftSidebarVisible={false}
|
||||||
|
rightSidebarVisible={false}
|
||||||
|
rightSidebarAvailable={false}
|
||||||
|
toggleLeftSidebarVisible={() => {}}
|
||||||
|
toggleRightSidebarVisible={() => {}}
|
||||||
|
setActiveSheet={_sheet => {}}
|
||||||
|
/>
|
||||||
|
</Provider>,
|
||||||
|
);
|
||||||
|
expect(component.toJSON()).toMatchSnapshot();
|
||||||
|
});
|
||||||
106
src/chrome/__tests__/__snapshots__/TitleBar.electron.js.snap
Normal file
106
src/chrome/__tests__/__snapshots__/TitleBar.electron.js.snap
Normal file
@@ -0,0 +1,106 @@
|
|||||||
|
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
||||||
|
|
||||||
|
exports[`TitleBar is rendered 1`] = `
|
||||||
|
<div
|
||||||
|
className="toolbar css-78eqwq"
|
||||||
|
>
|
||||||
|
<div
|
||||||
|
className="css-q7gju5"
|
||||||
|
onClick={[Function]}
|
||||||
|
onMouseDown={[Function]}
|
||||||
|
onMouseUp={[Function]}
|
||||||
|
>
|
||||||
|
<div
|
||||||
|
className="css-1h9aj9a"
|
||||||
|
color="#acacac"
|
||||||
|
size={12}
|
||||||
|
src="https://external.xx.fbcdn.net/assets/?name=minus-circle&variant=filled&size=12&set=facebook_icons&density=1x"
|
||||||
|
/>
|
||||||
|
No device selected
|
||||||
|
</div>
|
||||||
|
<div
|
||||||
|
className="css-1ayt83l"
|
||||||
|
>
|
||||||
|
<div
|
||||||
|
className="css-rb77sv"
|
||||||
|
disabled={true}
|
||||||
|
onClick={[Function]}
|
||||||
|
onMouseDown={[Function]}
|
||||||
|
onMouseUp={[Function]}
|
||||||
|
title="Take Screenshot"
|
||||||
|
>
|
||||||
|
<div
|
||||||
|
className="css-1dg3xuk"
|
||||||
|
color="#acacac"
|
||||||
|
size={12}
|
||||||
|
src="https://external.xx.fbcdn.net/assets/?name=camera&variant=filled&size=12&set=facebook_icons&density=1x"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
<div
|
||||||
|
className="css-rb77sv"
|
||||||
|
disabled={true}
|
||||||
|
onClick={[Function]}
|
||||||
|
onMouseDown={[Function]}
|
||||||
|
onMouseUp={[Function]}
|
||||||
|
title="Make Screen Recording"
|
||||||
|
>
|
||||||
|
<div
|
||||||
|
className="css-wvm62d"
|
||||||
|
color="#acacac"
|
||||||
|
size={12}
|
||||||
|
src="https://external.xx.fbcdn.net/assets/?name=camcorder&variant=filled&size=12&set=facebook_icons&density=1x"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div
|
||||||
|
className="css-12zzrdt"
|
||||||
|
/>
|
||||||
|
<div
|
||||||
|
className="css-1cecbfb"
|
||||||
|
onClick={[Function]}
|
||||||
|
onMouseDown={[Function]}
|
||||||
|
onMouseUp={[Function]}
|
||||||
|
title="Report Bug"
|
||||||
|
>
|
||||||
|
<div
|
||||||
|
className="css-1idwz0j"
|
||||||
|
color="#acacac"
|
||||||
|
size={12}
|
||||||
|
src="https://external.xx.fbcdn.net/assets/?name=bug&variant=filled&size=12&set=facebook_icons&density=1x"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
<div
|
||||||
|
className="css-1ayt83l"
|
||||||
|
>
|
||||||
|
<div
|
||||||
|
className="css-u1e6jr"
|
||||||
|
onClick={[Function]}
|
||||||
|
onMouseDown={[Function]}
|
||||||
|
onMouseUp={[Function]}
|
||||||
|
title="Toggle Plugins"
|
||||||
|
>
|
||||||
|
<div
|
||||||
|
className="css-2bfl92"
|
||||||
|
color="#80a6f5"
|
||||||
|
size={20}
|
||||||
|
src="icons/sidebar_left.svg"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
<div
|
||||||
|
className="css-rb77sv"
|
||||||
|
disabled={true}
|
||||||
|
onClick={[Function]}
|
||||||
|
onMouseDown={[Function]}
|
||||||
|
onMouseUp={[Function]}
|
||||||
|
title="Toggle Details"
|
||||||
|
>
|
||||||
|
<div
|
||||||
|
className="css-j5i4pm"
|
||||||
|
color="#acacac"
|
||||||
|
size={20}
|
||||||
|
src="icons/sidebar_right.svg"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
`;
|
||||||
Reference in New Issue
Block a user