Skip to content

A fully open source & end-to-end encrypted note taking alternative to Evernote.

mobile: add tests

Ammar Ahmed38600bf2a501
diff --git a/apps/mobile/app/screens/search/search-bar.tsx b/apps/mobile/app/screens/search/search-bar.tsx
index b18e8d7d4..adb63db29 100644
--- a/apps/mobile/app/screens/search/search-bar.tsx
+++ b/apps/mobile/app/screens/search/search-bar.tsx
@@ -108,6 +108,7 @@ export const SearchBar = ({
name="close"
size={AppFontSize.xxl}
top={10}
+ testID="clear-search"
bottom={10}
onPress={() => {
inputRef.current?.clear();
diff --git a/apps/mobile/e2e/globalSetup.ts b/apps/mobile/e2e/globalSetup.ts
index d66b68254..bc92efa4b 100644
--- a/apps/mobile/e2e/globalSetup.ts
+++ b/apps/mobile/e2e/globalSetup.ts
@@ -1,5 +1,5 @@
import { execSync } from "child_process";
-
+//@ts-ignore
import { pathExists, ensureDir } from "fs-extra";
import { resolveConfig } from "detox/internals";
diff --git a/apps/mobile/e2e/tests/search.e2e.ts b/apps/mobile/e2e/tests/search.e2e.ts
index f55f739d4..df04d214b 100644
--- a/apps/mobile/e2e/tests/search.e2e.ts
+++ b/apps/mobile/e2e/tests/search.e2e.ts
@@ -28,6 +28,9 @@ describe("Search", () => {
.typeTextById("search-input", "Test")
.wait(1000)
.isVisibleByText("1")
+ .waitAndTapById("clear-search")
+ .wait(2000)
+ .isNotVisibleByText("1")
.run();
});
});
diff --git a/apps/mobile/e2e/tests/utils.ts b/apps/mobile/e2e/tests/utils.ts
index d7c549261..5955af2af 100644
--- a/apps/mobile/e2e/tests/utils.ts
+++ b/apps/mobile/e2e/tests/utils.ts
@@ -20,6 +20,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
import { expect as jestExpect } from "@jest/globals";
import { device as _device, expect } from "detox";
import { readFileSync } from "fs";
+//@ts-ignore
import { toMatchImageSnapshot } from "jest-image-snapshot";
import type { RouteName } from "../../app/stores/use-navigation-store";
import { notesnook } from "../test.ids";
diff --git a/package.json b/package.json
index b4ae7467b..89ee5dec2 100644
--- a/package.json
+++ b/package.json
@@ -104,6 +104,10 @@
"run-ios",
"build-ios",
"build-android",
+ "build-android-debug",
+ "e2e-android-debug",
+ "e2e-android",
+ "e2e-ios",
"release-android",
"release-android-bundle",
"release-ios",