Skip to content

Commit fe61834

Browse files
committed
wip updateStatusBar platform test cases
1 parent b73a6f6 commit fe61834

File tree

1 file changed

+36
-14
lines changed

1 file changed

+36
-14
lines changed

__tests__/DropdownAlert-test.js

Lines changed: 36 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -401,21 +401,43 @@ describe('DropdownAlert component', () => {
401401
});
402402
});
403403
describe('updateStatusBar', () => {
404-
// FIXME: mock platform
405-
// jest.mock('Platform', () => ({
406-
// OS: 'android',
407-
// }));
408-
test('expect should update status bar to active state', () => {
409-
const wrapper = shallow(<DropdownAlert imageSrc={imageSrc} />);
410-
wrapper.instance().updateStatusBar(true, true);
411-
});
412-
test('expect should not update status bar', () => {
413-
const wrapper = shallow(<DropdownAlert imageSrc={imageSrc} />);
414-
wrapper.instance().updateStatusBar(false, true);
404+
describe('ios', () => {
405+
beforeEach(() => {
406+
jest.mock('Platform', () => ({
407+
OS: 'ios',
408+
}));
409+
});
410+
test('expect should update status bar to active state', () => {
411+
const wrapper = shallow(<DropdownAlert imageSrc={imageSrc} />);
412+
wrapper.instance().updateStatusBar(true, true);
413+
});
414+
test('expect should not update status bar', () => {
415+
const wrapper = shallow(<DropdownAlert imageSrc={imageSrc} />);
416+
wrapper.instance().updateStatusBar(false, true);
417+
});
418+
test('expect without parameters to be okay', () => {
419+
const wrapper = shallow(<DropdownAlert imageSrc={imageSrc} />);
420+
wrapper.instance().updateStatusBar();
421+
});
415422
});
416-
test('expect without parameters to be okay', () => {
417-
const wrapper = shallow(<DropdownAlert imageSrc={imageSrc} />);
418-
wrapper.instance().updateStatusBar();
423+
describe('android', () => {
424+
beforeEach(() => {
425+
jest.mock('Platform', () => ({
426+
OS: 'android',
427+
}));
428+
});
429+
test('expect should update status bar to active state', () => {
430+
const wrapper = shallow(<DropdownAlert imageSrc={imageSrc} />);
431+
wrapper.instance().updateStatusBar(true, true);
432+
});
433+
test('expect should not update status bar', () => {
434+
const wrapper = shallow(<DropdownAlert imageSrc={imageSrc} />);
435+
wrapper.instance().updateStatusBar(false, true);
436+
});
437+
test('expect without parameters to be okay', () => {
438+
const wrapper = shallow(<DropdownAlert imageSrc={imageSrc} />);
439+
wrapper.instance().updateStatusBar();
440+
});
419441
});
420442
});
421443
describe('clearCloseTimeoutID', () => {});

0 commit comments

Comments
 (0)