diff --git a/src/chrome/__tests__/SettingsSheet.node.tsx b/src/chrome/__tests__/SettingsSheet.node.tsx new file mode 100644 index 000000000..d30959072 --- /dev/null +++ b/src/chrome/__tests__/SettingsSheet.node.tsx @@ -0,0 +1,73 @@ +/** + * 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 SettingsSheet from '../SettingsSheet'; +import React from 'react'; +import renderer from 'react-test-renderer'; +import configureStore from 'redux-mock-store'; +import {Provider} from 'react-redux'; + +function getStore({ + iosEnabled, + androidEnabled, + androidHome, +}: { + iosEnabled?: boolean; + androidEnabled?: boolean; + androidHome?: string; +}) { + return configureStore([])({ + application: { + sessionId: 'mysession', + xcodeCommandLineToolsDetected: iosEnabled, + }, + settingsState: { + enableAndroid: androidEnabled, + androidHome: androidHome, + }, + }); +} + +test('SettingsSheet snapshot with nothing enabled', () => { + const component = ( + + {}} /> + + ); + + expect(renderer.create(component).toJSON()).toMatchSnapshot(); +}); + +test('SettingsSheet snapshot with iOS enabled', () => { + const component = ( + + {}} /> + + ); + + expect(renderer.create(component).toJSON()).toMatchSnapshot(); +}); + +test('SettingsSheet snapshot with android enabled', () => { + const component = ( + + {}} /> + + ); + + expect(renderer.create(component).toJSON()).toMatchSnapshot(); +}); + +test('SettingsSheet snapshot with android home set', () => { + const component = ( + + {}} /> + + ); + + expect(renderer.create(component).toJSON()).toMatchSnapshot(); +}); diff --git a/src/chrome/__tests__/__snapshots__/SettingsSheet.node.tsx.snap b/src/chrome/__tests__/__snapshots__/SettingsSheet.node.tsx.snap new file mode 100644 index 000000000..dad611a79 --- /dev/null +++ b/src/chrome/__tests__/__snapshots__/SettingsSheet.node.tsx.snap @@ -0,0 +1,540 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`SettingsSheet snapshot with android enabled 1`] = ` +
+ + Settings + +
+
+
+
+ + Android Developer + +
+
+
+
+ + Android SDK Location + + +
+ dots-3-circle +
+
+
+
+
+
+
+
+ + iOS Developer + +
+
+
+
+ +
+ + Use xcode-select to enable or switch between xcode versions + +
+
+
+
+
+
+
+
+
+ Cancel +
+
+ Apply and Restart +
+
+
+`; + +exports[`SettingsSheet snapshot with android home set 1`] = ` +
+ + Settings + +
+
+
+
+ + Android Developer + +
+
+
+
+ + Android SDK Location + + +
+ dots-3-circle +
+
+
+
+
+
+
+
+
+ + iOS Developer + +
+
+
+
+ +
+ + Use xcode-select to enable or switch between xcode versions + +
+
+
+
+
+
+
+
+
+ Cancel +
+
+ Apply and Restart +
+
+
+`; + +exports[`SettingsSheet snapshot with iOS enabled 1`] = ` +
+ + Settings + +
+
+
+
+ + Android Developer + +
+
+
+
+ + Android SDK Location + + +
+ dots-3-circle +
+
+
+
+
+
+
+
+
+ + iOS Developer + +
+
+
+
+ +
+ + Use xcode-select to enable or switch between xcode versions + +
+
+
+
+
+
+
+
+ Cancel +
+
+ Apply and Restart +
+
+
+`; + +exports[`SettingsSheet snapshot with nothing enabled 1`] = ` +
+ + Settings + +
+
+
+
+ + Android Developer + +
+
+
+
+ + Android SDK Location + + +
+ dots-3-circle +
+
+
+
+
+
+
+
+
+ + iOS Developer + +
+
+
+
+ +
+ + Use xcode-select to enable or switch between xcode versions + +
+
+
+
+
+
+
+
+
+ Cancel +
+
+ Apply and Restart +
+
+
+`;