Skip to content

Commit

Permalink
update e2e test (currently broken)
Browse files Browse the repository at this point in the history
  • Loading branch information
achou11 committed Aug 23, 2023
1 parent 45d280d commit 1dd14f0
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions test-e2e/manager-basic.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { test } from 'brittle'
import { MapeoManager } from '../src/mapeo-manager.js'
import { KeyManager } from '@mapeo/crypto'

test('Managing multiple projects', async (t) => {
const manager = new MapeoManager()
Expand All @@ -12,17 +13,20 @@ test('Managing multiple projects', async (t) => {
'no projects exist when manager is initially created'
)

const createdProjectIds = [
await manager.createProject(),
await manager.createProject(),
await manager.createProject(),
]
const createdProjectId = await manager.createProject()

const addedProjectId =
KeyManager.generateProjectKeypair().publicKey.toString('hex')

await manager.addProject(addedProjectId)

const existingProjectIds = [createdProjectId, addedProjectId]

const allProjects = await manager.listProjects()

t.is(allProjects.length, createdProjectIds.length)
t.is(allProjects.length, existingProjectIds.length)
t.ok(
allProjects.every((p) => createdProjectIds.includes(p.projectId)),
allProjects.every((p) => existingProjectIds.includes(p.projectId)),
'all created projects are listed'
)
})

0 comments on commit 1dd14f0

Please sign in to comment.