Skip to content

Commit 2b4736e

Browse files
committed
test(app, android): handle missing sdcard better in test harness
if you use a non-play-store emulator, your sdcard may not always mount in the emulator, and this test did not handle the android-storage-is-null case well even though it is a legitimate case
1 parent be76c93 commit 2b4736e

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

packages/app/e2e/utilsStatics.e2e.js

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,23 @@ describe('utils()', function () {
2828
firebase.utils.FilePath.CACHES_DIRECTORY.should.be.a.String();
2929
firebase.utils.FilePath.DOCUMENT_DIRECTORY.should.be.a.String();
3030

31-
if (device.getPlatform() === 'android') {
31+
// Even on android it may be null, skip if so
32+
if (
33+
device.getPlatform() === 'android' &&
34+
firebase.utils.FilePath.EXTERNAL_DIRECTORY !== null
35+
) {
3236
firebase.utils.FilePath.EXTERNAL_DIRECTORY.should.be.a.String();
33-
firebase.utils.FilePath.EXTERNAL_STORAGE_DIRECTORY.should.be.a.String();
3437
} else {
3538
should.equal(firebase.utils.FilePath.EXTERNAL_DIRECTORY, null);
39+
}
40+
41+
// Even on android it may be null, skip if so
42+
if (
43+
device.getPlatform() === 'android' &&
44+
firebase.utils.FilePath.EXTERNAL_STORAGE_DIRECTORY !== null
45+
) {
46+
firebase.utils.FilePath.EXTERNAL_STORAGE_DIRECTORY.should.be.a.String();
47+
} else {
3648
should.equal(firebase.utils.FilePath.EXTERNAL_STORAGE_DIRECTORY, null);
3749
}
3850

0 commit comments

Comments
 (0)