feat: reconcile application vertical slices
Backfill the completed acquisitions, sales, dashboard, pricing, search, public detail, worker, migration, contracts, validation, tests, and implementation-status changes into one verified application slice.
This commit is contained in:
@@ -1,16 +1,34 @@
|
||||
import assert from 'node:assert/strict';
|
||||
import test from 'node:test';
|
||||
import assert from "node:assert/strict";
|
||||
import test from "node:test";
|
||||
|
||||
import { buildApp } from '../../src/app/build-app.js';
|
||||
import { buildApp } from "../../src/app/build-app.js";
|
||||
|
||||
test('returns a seller-scoped dashboard', async (testContext) => {
|
||||
test("returns a seller-scoped dashboard", async (testContext) => {
|
||||
const app = buildApp({
|
||||
authenticateAdmin: async () => ({ sellerId: 'seller-1' }),
|
||||
dashboardService: { async get({ sellerId }) { assert.equal(sellerId, 'seller-1'); return { counts: {}, financials: {}, recentSales: [], recentAcquisitions: [] }; } },
|
||||
authenticateAdmin: async () => ({ sellerId: "seller-1" }),
|
||||
dashboardService: {
|
||||
async get({ sellerId }) {
|
||||
assert.equal(sellerId, "seller-1");
|
||||
return {
|
||||
counts: {},
|
||||
financials: {},
|
||||
recentSales: [],
|
||||
recentAcquisitions: [],
|
||||
};
|
||||
},
|
||||
},
|
||||
});
|
||||
testContext.after(() => app.close());
|
||||
|
||||
const response = await app.inject({ method: 'GET', url: '/api/v1/admin/dashboard' });
|
||||
const response = await app.inject({
|
||||
method: "GET",
|
||||
url: "/api/v1/admin/dashboard",
|
||||
});
|
||||
assert.equal(response.statusCode, 200);
|
||||
assert.deepEqual(response.json().data, { counts: {}, financials: {}, recentSales: [], recentAcquisitions: [] });
|
||||
});
|
||||
assert.deepEqual(response.json().data, {
|
||||
counts: {},
|
||||
financials: {},
|
||||
recentSales: [],
|
||||
recentAcquisitions: [],
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user