fix: focus moves to editor when typing in title

streetwriters/notesnook#153
This commit is contained in:
thecodrr
2021-12-11 13:01:04 +05:00
parent 5fec9eeeea
commit 6e79ae6e06
8 changed files with 138 additions and 106 deletions

View File

@@ -1,7 +1,7 @@
/* eslint-disable no-undef */
const { expect } = require("@playwright/test");
const { getTestId, NOTE } = require(".");
const { getTestId, NOTE, createNote } = require(".");
const List = require("./listitemidbuilder");
async function isPresent(selector) {
@@ -42,4 +42,27 @@ async function checkNotePresence(viewId, index = 0, note = NOTE) {
return noteSelector.build();
}
module.exports = { isPresent, isAbsent, isToastPresent, checkNotePresence };
async function createNoteAndCheckPresence(
note = NOTE,
viewId = "home",
index = 0
) {
await createNote(note, "notes");
// make sure the note has saved.
await page.waitForTimeout(200);
let noteSelector = await checkNotePresence(viewId, index, note);
await page.click(noteSelector, { button: "left" });
return noteSelector;
}
module.exports = {
isPresent,
isAbsent,
isToastPresent,
checkNotePresence,
createNoteAndCheckPresence,
};