A fully open source & end-to-end encrypted note taking alternative to Evernote.
TypeScript asp-net-coredotnet-coreelectronfosshacktoberfestnote-managmentnote-takingnote-taking-appnotebooknotesnotes-appopen-sourceopensourceprivacyproductivityreactreact-nativereactjsself-hosted
tests: pass tests for vault, tag, notes
ammarahm-ed41d70e6ebeac
diff --git "a/apps/mobile/artifacts/android.emu.debug.2022-08-10 05-58-51Z/\342\234\227 VAULT Change vault password/note-after-vault-unlock.png" "b/apps/mobile/artifacts/android.emu.debug.2022-08-10 05-58-51Z/\342\234\227 VAULT Change vault password/note-after-vault-unlock.png"new file mode 100644index 000000000..423ce4c97Binary files /dev/null and "b/apps/mobile/artifacts/android.emu.debug.2022-08-10 05-58-51Z/\342\234\227 VAULT Change vault password/note-after-vault-unlock.png" differdiff --git "a/apps/mobile/artifacts/android.emu.debug.2022-08-10 06-04-09Z/\342\234\227 VAULT Change vault password/note-after-vault-unlock.png" "b/apps/mobile/artifacts/android.emu.debug.2022-08-10 06-04-09Z/\342\234\227 VAULT Change vault password/note-after-vault-unlock.png"new file mode 100644index 000000000..f472dd22bBinary files /dev/null and "b/apps/mobile/artifacts/android.emu.debug.2022-08-10 06-04-09Z/\342\234\227 VAULT Change vault password/note-after-vault-unlock.png" differdiff --git "a/apps/mobile/artifacts/android.emu.debug.2022-08-10 06-06-45Z/\342\234\227 VAULT Change vault password/note-after-vault-unlock.png" "b/apps/mobile/artifacts/android.emu.debug.2022-08-10 06-06-45Z/\342\234\227 VAULT Change vault password/note-after-vault-unlock.png"new file mode 100644index 000000000..b9212a9b7Binary files /dev/null and "b/apps/mobile/artifacts/android.emu.debug.2022-08-10 06-06-45Z/\342\234\227 VAULT Change vault password/note-after-vault-unlock.png" differdiff --git "a/apps/mobile/artifacts/android.emu.debug.2022-08-10 06-07-35Z/\342\234\223 VAULT Change vault password/note-after-vault-unlock.png" "b/apps/mobile/artifacts/android.emu.debug.2022-08-10 06-07-35Z/\342\234\223 VAULT Change vault password/note-after-vault-unlock.png"new file mode 100644index 000000000..9b7688263Binary files /dev/null and "b/apps/mobile/artifacts/android.emu.debug.2022-08-10 06-07-35Z/\342\234\223 VAULT Change vault password/note-after-vault-unlock.png" differdiff --git "a/apps/mobile/artifacts/android.emu.debug.2022-08-10 06-10-52Z/\342\234\223 VAULT Add a note to vault/note-after-vault-unlock.png" "b/apps/mobile/artifacts/android.emu.debug.2022-08-10 06-10-52Z/\342\234\223 VAULT Add a note to vault/note-after-vault-unlock.png"new file mode 100644index 000000000..5083ce03dBinary files /dev/null and "b/apps/mobile/artifacts/android.emu.debug.2022-08-10 06-10-52Z/\342\234\223 VAULT Add a note to vault/note-after-vault-unlock.png" differdiff --git a/apps/mobile/e2e/tests/__image_snapshots__/vault-e-2-e-js-basic-tests-add-a-note-to-vault-1-snap.png b/apps/mobile/e2e/tests/__image_snapshots__/vault-e-2-e-js-basic-tests-add-a-note-to-vault-1-snap.pngdeleted file mode 100644index 5e36c5e0b..000000000Binary files a/apps/mobile/e2e/tests/__image_snapshots__/vault-e-2-e-js-basic-tests-add-a-note-to-vault-1-snap.png and /dev/null differdiff --git a/apps/mobile/e2e/tests/__image_snapshots__/vault-e-2-e-js-vault-add-a-note-to-vault-1-snap.png b/apps/mobile/e2e/tests/__image_snapshots__/vault-e-2-e-js-vault-add-a-note-to-vault-1-snap.pngnew file mode 100644index 000000000..5083ce03dBinary files /dev/null and b/apps/mobile/e2e/tests/__image_snapshots__/vault-e-2-e-js-vault-add-a-note-to-vault-1-snap.png differdiff --git a/apps/mobile/e2e/tests/__image_snapshots__/vault-e-2-e-js-vault-change-vault-password-1-snap.png b/apps/mobile/e2e/tests/__image_snapshots__/vault-e-2-e-js-vault-change-vault-password-1-snap.pngindex 5e36c5e0b..9b7688263 100644Binary files a/apps/mobile/e2e/tests/__image_snapshots__/vault-e-2-e-js-vault-change-vault-password-1-snap.png and b/apps/mobile/e2e/tests/__image_snapshots__/vault-e-2-e-js-vault-change-vault-password-1-snap.png differdiff --git a/apps/mobile/e2e/tests/__image_snapshots__/vault-e-2-e-js-vault-tests-add-a-note-to-vault-1-snap.png b/apps/mobile/e2e/tests/__image_snapshots__/vault-e-2-e-js-vault-tests-add-a-note-to-vault-1-snap.pngdeleted file mode 100644index 5e36c5e0b..000000000Binary files a/apps/mobile/e2e/tests/__image_snapshots__/vault-e-2-e-js-vault-tests-add-a-note-to-vault-1-snap.png and /dev/null differdiff --git a/apps/mobile/e2e/tests/note.e2e.js b/apps/mobile/e2e/tests/note.e2e.jsindex 5b833ec0e..d821dc8dc 100644--- a/apps/mobile/e2e/tests/note.e2e.js+++ b/apps/mobile/e2e/tests/note.e2e.js@@ -8,7 +8,8 @@ const {visibleById,notVisibleById,sleep,- exitEditor+ exitEditor,+ tapByText} = require('./utils');describe('NOTE TESTS', () => {@@ -103,7 +104,10 @@ describe('NOTE TESTS', () => {await createNote();await tapById(notesnook.listitem.menu);await tapById('icon-Delete');- await tapById(notesnook.toast.button);+ await navigate('Trash');+ await tapById(notesnook.listitem.menu);+ await tapByText('Restore note');+ await device.pressBack();await visibleByText('Test note description that is very long and should not fit in text.');});});diff --git a/apps/mobile/e2e/tests/sort.e2e.js b/apps/mobile/e2e/tests/sort.e2e.jsindex ecead644b..7835a7dcc 100644--- a/apps/mobile/e2e/tests/sort.e2e.js+++ b/apps/mobile/e2e/tests/sort.e2e.js@@ -27,20 +27,19 @@ describe('Sort & filter', () => {await sleep(300);await tapByText('Note 1');await sleep(500);- await elementById(notesnook.editor.id).tap({- x: 40,- y: 100- });- await elementById(notesnook.editor.id).typeText(' hello');- await tapById(notesnook.editor.back);- await sleep(500);+ let webview = web(by.id(notesnook.editor.id));+ await expect(webview.element(by.web.className('ProseMirror'))).toExist();+ await webview.element(by.web.className('ProseMirror')).tap();+ await webview.element(by.web.className('ProseMirror')).typeText('Edited ', true);+ await device.pressBack();+ await device.pressBack();await sortBy('Date created');await tapById(notesnook.listitem.menu);await visibleByText('Note 2');await device.pressBack();await sortBy('Date edited');await tapById(notesnook.listitem.menu);- await visibleByText('Note 1 hello');+ await visibleByText('Edited Note 1');await device.pressBack();});diff --git a/apps/mobile/e2e/tests/tag.e2e.js b/apps/mobile/e2e/tests/tag.e2e.jsindex d25354a24..60164124a 100644--- a/apps/mobile/e2e/tests/tag.e2e.js+++ b/apps/mobile/e2e/tests/tag.e2e.js@@ -75,6 +75,7 @@ describe('Tags', () => {await device.pressBack();await navigate('Tags');await tapById(notesnook.ids.tag.menu);+ await sleep(500);await tapByText('Rename tag');await sleep(500);await elementById('input-value').clearText();diff --git a/apps/mobile/e2e/tests/vault.e2e.js b/apps/mobile/e2e/tests/vault.e2e.jsindex a52855411..83e9a9dab 100644--- a/apps/mobile/e2e/tests/vault.e2e.js+++ b/apps/mobile/e2e/tests/vault.e2e.js@@ -10,7 +10,8 @@ const {expectBitmapsToBeEqual,matchSnapshot,notVisibleById,- navigate+ navigate,+ openSideMenu} = require('./utils');const { sleep } = require('./utils');@@ -48,7 +49,7 @@ async function openLockedNote(pwd) {async function goToPrivacySecuritySettings() {await navigate('Settings');- await tapByText('Privacy & security');+ await tapByText('Vault');}describe('VAULT', () => {@@ -72,8 +73,8 @@ describe('VAULT', () => {await elementById(notesnook.ids.dialogs.vault.pwd).typeText('1234');await elementById(notesnook.ids.dialogs.vault.changePwd).typeText('2362');await tapByText('Change');- await sleep(100);- await navigate('Notes');+ await device.pressBack();+ await device.pressBack();await openLockedNote('2362');});@@ -87,7 +88,8 @@ describe('VAULT', () => {await tapByText('Delete');await sleep(500);await visibleByText('Create vault');- await navigate('Notes');+ await device.pressBack();+ await device.pressBack();await visibleById(notesnook.listitem.menu);});@@ -102,7 +104,8 @@ describe('VAULT', () => {await tapByText('Delete');await sleep(500);await visibleByText('Create vault');- await navigate('Notes');+ await device.pressBack();+ await device.pressBack();await notVisibleById(notesnook.listitem.menu);});diff --git a/apps/mobile/src/services/eventmanager.ts b/apps/mobile/src/services/eventmanager.tsindex a43b2b751..46517ace5 100644--- a/apps/mobile/src/services/eventmanager.ts+++ b/apps/mobile/src/services/eventmanager.ts@@ -2,6 +2,7 @@ import Clipboard from '@react-native-clipboard/clipboard';import EventManager from '@streetwriters/notesnook-core/utils/event-manager';import { RefObject } from 'react';import ActionSheet from 'react-native-actions-sheet';+import { Config } from 'react-native-config';import {eHideToast,eOnNoteEdited,@@ -9,6 +10,7 @@ import {eOpenVaultDialog,eShowToast} from '../utils/events';+const eventManager = new EventManager();export const eSubscribeEvent = (eventName: string, action?: (data: any) => void) => {@@ -107,16 +109,18 @@ export const ToastEvent = {duration = 3000,func,actionText- }: ShowToastEvent) =>+ }: ShowToastEvent) => {+ if (Config.isTesting) return;eSendEvent(eShowToast, {heading: heading,message: message,type: type,context: context,- duration: duration,+ duration: 3000,func: func,actionText: actionText- }),+ });+ },hide: () => eSendEvent(eHideToast),error: (e: Error, title?: string, context?: 'global' | 'local') => {ToastEvent.show({