web: fix notebook tests

This commit is contained in:
Abdullah Atta
2024-11-06 16:14:39 +05:00
parent 52c8d0b86c
commit 2337b8cd85
4 changed files with 52 additions and 28 deletions

View File

@@ -111,7 +111,7 @@ test("restore a notebook", async ({ page }) => {
await app.goToNotebooks(); await app.goToNotebooks();
const restoredNotebook = await notebooks.findNotebook(NOTEBOOK); const restoredNotebook = await notebooks.findNotebook(NOTEBOOK);
expect(restoredNotebook).toBeDefined(); expect(restoredNotebook).toBeDefined();
expect(await app.toasts.waitForToast("1 item restored")).toBe(true); expect(await app.toasts.waitForToast("Item restored")).toBe(true);
}); });
test("permanently delete a notebook", async ({ page }) => { test("permanently delete a notebook", async ({ page }) => {
@@ -224,7 +224,9 @@ test("delete all notes within a notebook", async ({ page }) => {
test("creating more than 20 notebooks shouldn't be possible on basic plan", async ({ test("creating more than 20 notebooks shouldn't be possible on basic plan", async ({
page page
}) => { }, info) => {
info.setTimeout(2 * 60 * 1000);
await page.exposeBinding("isBasic", () => true); await page.exposeBinding("isBasic", () => true);
const app = new AppModel(page); const app = new AppModel(page);
await app.goto(); await app.goto();
@@ -235,9 +237,7 @@ test("creating more than 20 notebooks shouldn't be possible on basic plan", asyn
const result = await Promise.race([ const result = await Promise.race([
notebooks.createNotebook(NOTEBOOK), notebooks.createNotebook(NOTEBOOK),
app.toasts.waitForToast( app.toasts.waitForToast("Upgrade to Notesnook Pro to add more notebooks.")
"Please upgrade your account to Pro to add more notebooks."
)
]); ]);
expect(result).toBe(true); expect(result).toBe(true);
}); });

View File

@@ -5858,6 +5858,10 @@ msgstr "Upgrade now"
msgid "Upgrade to Notesnook Pro to add colors." msgid "Upgrade to Notesnook Pro to add colors."
msgstr "Upgrade to Notesnook Pro to add colors." msgstr "Upgrade to Notesnook Pro to add colors."
#: src/strings.ts:1994
msgid "Upgrade to Notesnook Pro to add more notebooks."
msgstr "Upgrade to Notesnook Pro to add more notebooks."
#: src/strings.ts:1993 #: src/strings.ts:1993
msgid "Upgrade to Notesnook Pro to create more tags." msgid "Upgrade to Notesnook Pro to create more tags."
msgstr "Upgrade to Notesnook Pro to create more tags." msgstr "Upgrade to Notesnook Pro to create more tags."
@@ -5870,17 +5874,25 @@ msgstr "Upgrade to Notesnook Pro to customize the toolbar."
msgid "Upgrade to Notesnook Pro to use custom toolbar presets." msgid "Upgrade to Notesnook Pro to use custom toolbar presets."
msgstr "Upgrade to Notesnook Pro to use custom toolbar presets." msgstr "Upgrade to Notesnook Pro to use custom toolbar presets."
#: src/strings.ts:1994
msgid "Upgrade to Notesnook Proto add more notebooks."
msgstr "Upgrade to Notesnook Proto add more notebooks."
#: src/strings.ts:1995 #: src/strings.ts:1995
msgid "Upgrade to Notesnook Proto use the notes vault." msgid "Upgrade to Notesnook Pro to use the notes vault."
msgstr "Upgrade to Notesnook Proto use the notes vault." msgstr "Upgrade to Notesnook Pro to use the notes vault."
#: src/strings.ts:1998 #: src/strings.ts:1998
msgid "Upgrade to Notesnook Proto use this feature." msgid "Upgrade to Notesnook Pro to use this feature."
msgstr "Upgrade to Notesnook Proto use this feature." msgstr "Upgrade to Notesnook Pro to use this feature."
#: src/strings.ts:1994
#~ msgid "Upgrade to Notesnook Proto add more notebooks."
#~ msgstr "Upgrade to Notesnook Proto add more notebooks."
#: src/strings.ts:1995
#~ msgid "Upgrade to Notesnook Proto use the notes vault."
#~ msgstr "Upgrade to Notesnook Proto use the notes vault."
#: src/strings.ts:1998
#~ msgid "Upgrade to Notesnook Proto use this feature."
#~ msgstr "Upgrade to Notesnook Proto use this feature."
#: src/strings.ts:705 #: src/strings.ts:705
msgid "Upgrade to Pro" msgid "Upgrade to Pro"

View File

@@ -5826,6 +5826,10 @@ msgstr ""
msgid "Upgrade to Notesnook Pro to add colors." msgid "Upgrade to Notesnook Pro to add colors."
msgstr "" msgstr ""
#: src/strings.ts:1994
msgid "Upgrade to Notesnook Pro to add more notebooks."
msgstr ""
#: src/strings.ts:1993 #: src/strings.ts:1993
msgid "Upgrade to Notesnook Pro to create more tags." msgid "Upgrade to Notesnook Pro to create more tags."
msgstr "" msgstr ""
@@ -5838,18 +5842,26 @@ msgstr ""
msgid "Upgrade to Notesnook Pro to use custom toolbar presets." msgid "Upgrade to Notesnook Pro to use custom toolbar presets."
msgstr "" msgstr ""
#: src/strings.ts:1994
msgid "Upgrade to Notesnook Proto add more notebooks."
msgstr ""
#: src/strings.ts:1995 #: src/strings.ts:1995
msgid "Upgrade to Notesnook Proto use the notes vault." msgid "Upgrade to Notesnook Pro to use the notes vault."
msgstr "" msgstr ""
#: src/strings.ts:1998 #: src/strings.ts:1998
msgid "Upgrade to Notesnook Proto use this feature." msgid "Upgrade to Notesnook Pro to use this feature."
msgstr "" msgstr ""
#: src/strings.ts:1994
#~ msgid "Upgrade to Notesnook Proto add more notebooks."
#~ msgstr ""
#: src/strings.ts:1995
#~ msgid "Upgrade to Notesnook Proto use the notes vault."
#~ msgstr ""
#: src/strings.ts:1998
#~ msgid "Upgrade to Notesnook Proto use this feature."
#~ msgstr ""
#: src/strings.ts:705 #: src/strings.ts:705
msgid "Upgrade to Pro" msgid "Upgrade to Pro"
msgstr "" msgstr ""

View File

@@ -1900,12 +1900,12 @@ All attachments will be downloaded & cached again on access.
backupSavedAt: (path: string) => t`Backup saved at ${path}`, backupSavedAt: (path: string) => t`Backup saved at ${path}`,
movedToTrash: (type: string, count: number) => movedToTrash: (type: string, count: number) =>
plural(count, { plural(count, {
one: `1 ${ one: `1 ${strings.dataTypes[
strings.dataTypes[type as keyof typeof strings.dataTypes] type as keyof typeof strings.dataTypes
} moved to trash`, ]()} moved to trash`,
other: `# ${ other: `# ${strings.dataTypesPlural[
strings.dataTypesPlural[type as keyof typeof strings.dataTypesPlural] type as keyof typeof strings.dataTypesPlural
} moved to trash` ]()} moved to trash`
}), }),
irreverisibleAction: () => t`This action is IRREVERSIBLE.`, irreverisibleAction: () => t`This action is IRREVERSIBLE.`,
doAction: (type: string, count: number, action: DoActions) => doAction: (type: string, count: number, action: DoActions) =>
@@ -1991,11 +1991,11 @@ All attachments will be downloaded & cached again on access.
const features = { const features = {
color: t`Upgrade to Notesnook Pro to add colors.`, color: t`Upgrade to Notesnook Pro to add colors.`,
tags: t`Upgrade to Notesnook Pro to create more tags.`, tags: t`Upgrade to Notesnook Pro to create more tags.`,
notebook: t` Upgrade to Notesnook Proto add more notebooks.`, notebook: t` Upgrade to Notesnook Pro to add more notebooks.`,
vault: t` Upgrade to Notesnook Proto use the notes vault.`, vault: t` Upgrade to Notesnook Pro to use the notes vault.`,
customPresets: t` Upgrade to Notesnook Pro to use custom toolbar presets.`, customPresets: t` Upgrade to Notesnook Pro to use custom toolbar presets.`,
customizeToolbar: t` Upgrade to Notesnook Pro to customize the toolbar.`, customizeToolbar: t` Upgrade to Notesnook Pro to customize the toolbar.`,
default: t` Upgrade to Notesnook Proto use this feature.` default: t` Upgrade to Notesnook Pro to use this feature.`
}; };
return features[feature as keyof typeof features]; return features[feature as keyof typeof features];
}, },