From 9a3ce67543bf235fab2a0f58d4395c7dc0f2f652 Mon Sep 17 00:00:00 2001 From: DarkSky Date: Wed, 4 Sep 2024 14:58:47 +0800 Subject: [PATCH] feat: enable more test --- y-octo-node/tests/yjs/y-array.spec.ts | 3 +-- y-octo-node/tests/yjs/y-map.spec.ts | 11 +++++------ 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/y-octo-node/tests/yjs/y-array.spec.ts b/y-octo-node/tests/yjs/y-array.spec.ts index 2b88b9c..a88d673 100644 --- a/y-octo-node/tests/yjs/y-array.spec.ts +++ b/y-octo-node/tests/yjs/y-array.spec.ts @@ -126,8 +126,7 @@ test.skip("testDeleteInsert", (t) => { compare(users); }); -// TODO: impl sync protocol encode in rust -test.skip("testInsertThreeElementsTryRegetProperty", (t) => { +test("testInsertThreeElementsTryRegetProperty", (t) => { const { testConnector, users, array0, array1 } = init(gen, { users: 2 }); array0.insert(0, [1, true, false]); diff --git a/y-octo-node/tests/yjs/y-map.spec.ts b/y-octo-node/tests/yjs/y-map.spec.ts index 4e74e9c..fb8ec78 100644 --- a/y-octo-node/tests/yjs/y-map.spec.ts +++ b/y-octo-node/tests/yjs/y-map.spec.ts @@ -259,7 +259,7 @@ test("testSizeAndDeleteOfMapProperty", (t) => { testConnector.disconnectAll(); }); -test.skip("testGetAndSetAndDeleteOfMapProperty", (t) => { +test("testGetAndSetAndDeleteOfMapProperty", (t) => { const { testConnector, users, map0, map1 } = init(gen, { users: 3 }); map0.set("stuff", "c0"); @@ -268,10 +268,9 @@ test.skip("testGetAndSetAndDeleteOfMapProperty", (t) => { testConnector.flushAllMessages(); for (const user of users) { const u = user.getOrCreateMap("map"); - t.assert(u.get("stuff") === undefined); + t.is(u.get("stuff"), null); } compare(users); - testConnector.disconnectAll() }); test.skip("testSetAndClearOfMapProperties", (t) => { @@ -283,9 +282,9 @@ test.skip("testSetAndClearOfMapProperties", (t) => { testConnector.flushAllMessages(); for (const user of users) { const u = user.getOrCreateMap("map"); - t.assert(u.get("stuff") === undefined); - t.assert(u.get("otherstuff") === undefined); - t.assert(u.size === 0, `map size after clear is ${u.size}, expected 0`); + t.is(u.get("stuff"), null); + t.is(u.get("otherstuff"), null); + t.is(u.size, 0, `map size after clear is ${u.size}, expected 0`); } compare(users); });