Browse Source

Fix (commented!) workspaces list test.

Afshin Darian 6 years ago
parent
commit
e88f8c61ce
1 changed files with 11 additions and 10 deletions
  1. 11 10
      tests/test-services/src/workspace/manager.spec.ts

+ 11 - 10
tests/test-services/src/workspace/manager.spec.ts

@@ -49,16 +49,17 @@ describe('workspace', () => {
       });
     });
 
-    // describe('#list()', async () => {
-    //   it('should fetch a workspace list supporting arbitrary IDs', async () => {
-    //     const ids = ['foo', 'bar', 'baz', 'f/o/o', 'b/a/r', 'b/a/z'];
-
-    //     ids.forEach(async id => {
-    //       await manager.save(id, { data: {}, metadata: { id } });
-    //     });
-    //     expect((await manager.list()).sort()).to.deep.equal(ids.sort());
-    //   });
-    // });
+    describe('#list()', async () => {
+      it('should fetch a workspace list supporting arbitrary IDs', async () => {
+        const ids = ['foo', 'bar', 'baz', 'f/o/o', 'b/a/r', 'b/a/z'];
+        const promises = ids.map(id =>
+          manager.save(id, { data: {}, metadata: { id } })
+        );
+
+        await Promise.all(promises);
+        expect((await manager.list()).ids.sort()).to.deep.equal(ids.sort());
+      });
+    });
 
     describe('#remove()', () => {
       it('should remove a workspace', async () => {