Skip to content

A fully open source & end-to-end encrypted note taking alternative to Evernote.

core: fix sync tests and remove obsolete snapshots

Abdullah Atta89ee0f8d27ac
diff --git a/packages/core/__e2e__/__snapshots__/offers.test.js.snap b/packages/core/__e2e__/__snapshots__/offers.test.js.snap
index be68ed162..00d563ca3 100644
--- a/packages/core/__e2e__/__snapshots__/offers.test.js.snap
+++ b/packages/core/__e2e__/__snapshots__/offers.test.js.snap
@@ -1,5 +1,3 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`get offer code > offer-code 1`] = `"123"`;
-
-exports[`get offer code > offer-code 2`] = `"123"`;
diff --git a/packages/core/__e2e__/__snapshots__/pricing.test.js.snap b/packages/core/__e2e__/__snapshots__/pricing.test.js.snap
index 1ace5ae40..49e608e4c 100644
--- a/packages/core/__e2e__/__snapshots__/pricing.test.js.snap
+++ b/packages/core/__e2e__/__snapshots__/pricing.test.js.snap
@@ -63,15 +63,6 @@ exports[`get web pricing tier > get monthly web tier > monthly-web-pricing 1`] =
}
`;
-exports[`get web pricing tier > get monthly web tier > yearly-ios-pricing 1`] = `
-{
- "country": Any<String>,
- "countryCode": Any<String>,
- "discount": Any<Number>,
- "sku": Any<String>,
-}
-`;
-
exports[`get web pricing tier > get yearly web tier > yearly-web-pricing 1`] = `
{
"country": Any<String>,
@@ -81,15 +72,6 @@ exports[`get web pricing tier > get yearly web tier > yearly-web-pricing 1`] = `
}
`;
-exports[`get yearly price > monthly-pricing 1`] = `
-{
- "country": Any<String>,
- "countryCode": Any<String>,
- "discount": Any<Number>,
- "price": Any<Number>,
-}
-`;
-
exports[`get yearly price > yearly-pricing 1`] = `
{
"country": Any<String>,
diff --git a/packages/core/__e2e__/sync.test.js b/packages/core/__e2e__/sync.test.js
index b20a515f5..90a8785dc 100644
--- a/packages/core/__e2e__/sync.test.js
+++ b/packages/core/__e2e__/sync.test.js
@@ -17,16 +17,10 @@ You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-import Database from "../src/api/index.ts";
-import { NodeStorageInterface } from "../__mocks__/node-storage.mock.ts";
-import { FS } from "../__mocks__/fs.mock.ts";
-import Compressor from "../__mocks__/compressor.mock.js";
import { CHECK_IDS, EV, EVENTS } from "../src/common.ts";
-import { EventSource } from "event-source-polyfill";
import { test, expect, vitest } from "vitest";
import { login } from "./utils.js";
-import { SqliteDialect } from "@streetwriters/kysely";
-import BetterSQLite3 from "better-sqlite3-multiple-ciphers";
+import { databaseTest } from "../__tests__/utils/index.ts";
const TEST_TIMEOUT = 60 * 1000;
@@ -499,22 +493,7 @@ async function initializeDevice(id, capabilities = []) {
};
});
- const device = new Database();
- device.setup({
- storage: new NodeStorageInterface(),
- eventsource: EventSource,
- fs: FS,
- compressor: async () => Compressor,
- sqliteOptions: {
- dialect: (name) =>
- new SqliteDialect({
- database: BetterSQLite3(":memory:").unsafeMode(true)
- })
- },
- batchSize: 500
- });
-
- await device.init();
+ const device = await databaseTest("memory");
await login(device);