Ver Fonte

fix(e2e): properties related apis

charlie há 9 meses atrás
pai
commit
c90ab6c090
1 ficheiros alterados com 11 adições e 0 exclusões
  1. 11 0
      e2e-tests/logseq-api.spec.ts

+ 11 - 0
e2e-tests/logseq-api.spec.ts

@@ -86,9 +86,13 @@ test('(File graph): block related apis',
     expect(mb.uuid).toBe(b.uuid)
 
     // properties
+    // FIXME: redundant api call
+    await callAPI('upsert_block_property', b1.uuid, 'a')
     await callAPI('upsert_block_property', b1.uuid, 'a', 1)
     let prop1 = await callAPI('get_block_property', b1.uuid, 'a')
 
+    expect(prop1).toBe(1)
+
     await callAPI('upsert_block_property', b1.uuid, 'a', 2)
     prop1 = await callAPI('get_block_property', b1.uuid, 'a')
 
@@ -199,5 +203,12 @@ test('(DB graph): block related apis',
 
     expect(prop1).toEqual({ ':plugin.property/a': 'a', ':plugin.property/b': 'b' })
 
+    // properties schema
+    await callAPI('upsert_property', 'p1')
+    prop1 = await callAPI('get_property', 'p1')
+
+    expect(prop1.title).toBe('p1')
+    expect(prop1.ident).toBe(':plugin.property/p1')
+
     // await page.pause()
   })