Skip to content
This repository has been archived by the owner on Jun 7, 2023. It is now read-only.

Commit

Permalink
Mobile: Use native dropdown component (#1275)
Browse files Browse the repository at this point in the history
  • Loading branch information
cvarley100 committed Apr 15, 2019
1 parent 9ba69fd commit 917d90b
Show file tree
Hide file tree
Showing 11 changed files with 120 additions and 287 deletions.
39 changes: 1 addition & 38 deletions src/mobile/__tests__/ui/components/Dropdown.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ const getProps = (overrides) =>
assign(
{},
{
t: () => '',
theme,
onRef: noop,
options: [],
Expand Down Expand Up @@ -61,42 +62,4 @@ describe('Testing Dropdown component', () => {
});
});
});

describe('when onPress prop on TouchableWithoutFeedback is triggered', () => {
beforeEach(() => {
jest.mock('LayoutAnimation');
});

describe('when disableWhen prop is false', () => {
it('should call instance method onDropdownTitlePress', () => {
const props = getProps();
const wrapper = shallow(<Dropdown {...props} />);
const instance = wrapper.instance();

jest.spyOn(instance, 'onDropdownTitlePress');
wrapper
.find('TouchableWithoutFeedback')
.props()
.onPress();

expect(instance.onDropdownTitlePress).toHaveBeenCalled();
});
});

describe('when disableWhen prop is true', () => {
it('should not call instance method onDropdownTitlePress', () => {
const props = getProps({ disableWhen: true });
const wrapper = shallow(<Dropdown {...props} />);
const instance = wrapper.instance();

jest.spyOn(instance, 'onDropdownTitlePress');
wrapper
.find('TouchableWithoutFeedback')
.props()
.onPress();

expect(instance.onDropdownTitlePress).toHaveBeenCalledTimes(0);
});
});
});
});
5 changes: 3 additions & 2 deletions src/mobile/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
"fix-modal": "node node_modules/react-native-modal-translucent/scripts/translucent-modal.js"
},
"dependencies": {
"@tradle/react-native-http": "^2.0.0",
"authenticator": "^1.1.3",
"axios": "^0.18.0",
"bugsnag-react-native": "^2.11.0",
Expand Down Expand Up @@ -69,6 +70,7 @@
"react-native-navigation": "https://github.com/rajivshah3/react-native-navigation#2.0.255-0.57",
"react-native-optimized-flatlist": "^1.0.4",
"react-native-os": "git+https://github.com/laumair/react-native-os.git#527b0ae",
"react-native-picker-select": "^6.1.0",
"react-native-print": "^0.5.0",
"react-native-progress": "^3.4.0",
"react-native-qr-generator": "^1.0.3",
Expand Down Expand Up @@ -98,8 +100,7 @@
"tweetnacl-util": "^0.15.0",
"util": "^0.10.3",
"victory-native": "^30.3.0",
"vm-browserify": "0.0.4",
"@tradle/react-native-http": "^2.0.0"
"vm-browserify": "0.0.4"
},
"devDependencies": {
"babel-jest": "24.0.0",
Expand Down
Loading

0 comments on commit 917d90b

Please sign in to comment.