diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0a9b4c78..3ae5c959 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -32,6 +32,7 @@ jobs: node-version: 20 - run: npm ci - run: npm test + - run: npm test build-publish: runs-on: ubuntu-latest diff --git a/api/test/test.js b/api/test/test.js index e2bea001..bb544abb 100644 --- a/api/test/test.js +++ b/api/test/test.js @@ -688,16 +688,16 @@ describe('Routes', () => { const res = await fetch(`${spark}/miner/f0230/deals/eligible/summary`) await assertResponseStatus(res, 200) assert.strictEqual(res.headers.get('cache-control'), 'max-age=21600') - // const body = await res.json() - // assert.deepStrictEqual(body, { - // minerId: 'f0230', - // dealCount: 5, - // clients: [ - // { clientId: 'f0800', dealCount: 3 }, - // { clientId: 'f0810', dealCount: 1 }, - // { clientId: 'f0820', dealCount: 1 } - // ] - // }) + const body = await res.json() + assert.deepStrictEqual(body, { + minerId: 'f0230', + dealCount: 4, + clients: [ + { clientId: 'f0800', dealCount: 2 }, + { clientId: 'f0810', dealCount: 1 }, + { clientId: 'f0820', dealCount: 1 } + ] + }) }) it('returns an empty array for miners with no deals in our DB', async () => { @@ -718,16 +718,16 @@ describe('Routes', () => { const res = await fetch(`${spark}/client/f0800/deals/eligible/summary`) await assertResponseStatus(res, 200) assert.strictEqual(res.headers.get('cache-control'), 'max-age=21600') - // const body = await res.json() - // assert.deepStrictEqual(body, { - // clientId: 'f0800', - // dealCount: 5, - // providers: [ - // { minerId: 'f0230', dealCount: 3 }, - // { minerId: 'f0210', dealCount: 1 }, - // { minerId: 'f0220', dealCount: 1 } - // ] - // }) + const body = await res.json() + assert.deepStrictEqual(body, { + clientId: 'f0800', + dealCount: 4, + providers: [ + { minerId: 'f0230', dealCount: 2 }, + { minerId: 'f0210', dealCount: 1 }, + { minerId: 'f0220', dealCount: 1 } + ] + }) }) it('returns an empty array for miners with no deals in our DB', async () => { @@ -748,15 +748,15 @@ describe('Routes', () => { const res = await fetch(`${spark}/allocator/f0500/deals/eligible/summary`) await assertResponseStatus(res, 200) assert.strictEqual(res.headers.get('cache-control'), 'max-age=21600') - // const body = await res.json() - // assert.deepStrictEqual(body, { - // allocatorId: 'f0500', - // dealCount: 7, - // clients: [ - // { clientId: 'f0800', dealCount: 5 }, - // { clientId: 'f0810', dealCount: 2 } - // ] - // }) + const body = await res.json() + assert.deepStrictEqual(body, { + allocatorId: 'f0500', + dealCount: 6, + clients: [ + { clientId: 'f0800', dealCount: 4 }, + { clientId: 'f0810', dealCount: 2 } + ] + }) }) it('returns an empty array for miners with no deals in our DB', async () => {