mirror of
https://github.com/streetwriters/notesnook.git
synced 2026-09-01 19:49:54 +02:00
mobile: add note tests
This commit is contained in:
@@ -34,6 +34,49 @@ describe("NOTE TESTS", () => {
|
||||
.run();
|
||||
});
|
||||
|
||||
it("Note history is created", async () => {
|
||||
await TestBuilder.create()
|
||||
.prepare()
|
||||
.createNote("Test note", "This is a test note")
|
||||
.waitAndTapById(notesnook.listitem.menu)
|
||||
.wait()
|
||||
.waitAndTapById("icon-history")
|
||||
.isNotVisibleByText("No note history available for this device.")
|
||||
.run();
|
||||
});
|
||||
|
||||
it("Duplicate note", async () => {
|
||||
await TestBuilder.create()
|
||||
.prepare()
|
||||
.createNote("Test note", "This is a test note")
|
||||
.waitAndTapById(notesnook.listitem.menu)
|
||||
.wait()
|
||||
.waitAndTapById("icon-duplicate")
|
||||
.isVisibleByText("Test note (Copy)")
|
||||
.run();
|
||||
});
|
||||
|
||||
it("Archive a note", async () => {
|
||||
await TestBuilder.create()
|
||||
.prepare()
|
||||
.createNote("Test note")
|
||||
.saveResult()
|
||||
.waitAndTapById(notesnook.listitem.menu)
|
||||
.wait(500)
|
||||
.waitAndTapById("icon-archive")
|
||||
.pressBack()
|
||||
.navigate("Archive")
|
||||
.isVisibleByText("Test note")
|
||||
.waitAndTapById(notesnook.listitem.menu)
|
||||
.wait(500)
|
||||
.waitAndTapById("icon-archive")
|
||||
.pressBack()
|
||||
.isNotVisibleByText("Test note")
|
||||
.navigate("Notes")
|
||||
.isVisibleByText("Test note")
|
||||
.run();
|
||||
});
|
||||
|
||||
it("Notes properties should show", async () => {
|
||||
await TestBuilder.create()
|
||||
.prepare()
|
||||
|
||||
@@ -91,14 +91,17 @@ const Tests = {
|
||||
await _device.pressBack();
|
||||
await _device.pressBack();
|
||||
},
|
||||
async createNote(_title?: string, _body?: string) {
|
||||
let title = _title || "Test note description that ";
|
||||
async createNote(title?: string, _body?: string) {
|
||||
let body =
|
||||
_body ||
|
||||
"Test note description that is very long and should not fit in text.";
|
||||
await Tests.fromId(notesnook.buttons.add).tap();
|
||||
if (title) {
|
||||
await web().element(by.web.id("editor-title")).focus();
|
||||
await web().element(by.web.id("editor-title")).typeText(title, false);
|
||||
}
|
||||
await expect(web().element(by.web.className("ProseMirror"))).toExist();
|
||||
// await web().element(by.web.className("ProseMirror")).tap();
|
||||
await web().element(by.web.className("ProseMirror")).focus();
|
||||
await web().element(by.web.className("ProseMirror")).typeText(body, true);
|
||||
await Tests.exitEditor();
|
||||
await Tests.fromText(body).isVisible();
|
||||
|
||||
@@ -107,6 +107,7 @@ function Title({
|
||||
<textarea
|
||||
ref={titleRef}
|
||||
className={styles.titleBar}
|
||||
id="editor-title"
|
||||
rows={1}
|
||||
contentEditable={!readonly}
|
||||
disabled={readonly}
|
||||
|
||||
Reference in New Issue
Block a user