mirror of
https://github.com/streetwriters/notesnook.git
synced 2025-12-16 03:37:55 +01:00
mobile: add tests
This commit is contained in:
@@ -108,6 +108,7 @@ export const SearchBar = ({
|
|||||||
name="close"
|
name="close"
|
||||||
size={AppFontSize.xxl}
|
size={AppFontSize.xxl}
|
||||||
top={10}
|
top={10}
|
||||||
|
testID="clear-search"
|
||||||
bottom={10}
|
bottom={10}
|
||||||
onPress={() => {
|
onPress={() => {
|
||||||
inputRef.current?.clear();
|
inputRef.current?.clear();
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { execSync } from "child_process";
|
import { execSync } from "child_process";
|
||||||
|
//@ts-ignore
|
||||||
import { pathExists, ensureDir } from "fs-extra";
|
import { pathExists, ensureDir } from "fs-extra";
|
||||||
|
|
||||||
import { resolveConfig } from "detox/internals";
|
import { resolveConfig } from "detox/internals";
|
||||||
|
|||||||
@@ -28,6 +28,9 @@ describe("Search", () => {
|
|||||||
.typeTextById("search-input", "Test")
|
.typeTextById("search-input", "Test")
|
||||||
.wait(1000)
|
.wait(1000)
|
||||||
.isVisibleByText("1")
|
.isVisibleByText("1")
|
||||||
|
.waitAndTapById("clear-search")
|
||||||
|
.wait(2000)
|
||||||
|
.isNotVisibleByText("1")
|
||||||
.run();
|
.run();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||||||
import { expect as jestExpect } from "@jest/globals";
|
import { expect as jestExpect } from "@jest/globals";
|
||||||
import { device as _device, expect } from "detox";
|
import { device as _device, expect } from "detox";
|
||||||
import { readFileSync } from "fs";
|
import { readFileSync } from "fs";
|
||||||
|
//@ts-ignore
|
||||||
import { toMatchImageSnapshot } from "jest-image-snapshot";
|
import { toMatchImageSnapshot } from "jest-image-snapshot";
|
||||||
import type { RouteName } from "../../app/stores/use-navigation-store";
|
import type { RouteName } from "../../app/stores/use-navigation-store";
|
||||||
import { notesnook } from "../test.ids";
|
import { notesnook } from "../test.ids";
|
||||||
|
|||||||
@@ -104,6 +104,10 @@
|
|||||||
"run-ios",
|
"run-ios",
|
||||||
"build-ios",
|
"build-ios",
|
||||||
"build-android",
|
"build-android",
|
||||||
|
"build-android-debug",
|
||||||
|
"e2e-android-debug",
|
||||||
|
"e2e-android",
|
||||||
|
"e2e-ios",
|
||||||
"release-android",
|
"release-android",
|
||||||
"release-android-bundle",
|
"release-android-bundle",
|
||||||
"release-ios",
|
"release-ios",
|
||||||
|
|||||||
Reference in New Issue
Block a user