fix(api): close M5 frontend contract gaps
This commit is contained in:
@@ -27,6 +27,7 @@ function createMobileQueryService() {
|
||||
getSpendReport: async () => ({ totals: { amountCents: 2000 } }),
|
||||
getSpendBreakdown: async () => ([{ category: 'Barista', amountCents: 1000 }]),
|
||||
getStaffDashboard: async () => ({ staffName: 'Ana Barista' }),
|
||||
getStaffReliabilityStats: async () => ({ totalShifts: 12, reliabilityScore: 96.4 }),
|
||||
getStaffProfileCompletion: async () => ({ completed: true }),
|
||||
getStaffSession: async () => ({ staff: { staffId: 's1' } }),
|
||||
getStaffShiftDetail: async () => ({ shiftId: 'shift-1' }),
|
||||
@@ -101,6 +102,17 @@ test('GET /query/staff/dashboard returns injected dashboard', async () => {
|
||||
assert.equal(res.body.staffName, 'Ana Barista');
|
||||
});
|
||||
|
||||
test('GET /query/staff/profile/stats returns injected reliability stats', async () => {
|
||||
const app = createApp({ mobileQueryService: createMobileQueryService() });
|
||||
const res = await request(app)
|
||||
.get('/query/staff/profile/stats')
|
||||
.set('Authorization', 'Bearer test-token');
|
||||
|
||||
assert.equal(res.status, 200);
|
||||
assert.equal(res.body.totalShifts, 12);
|
||||
assert.equal(res.body.reliabilityScore, 96.4);
|
||||
});
|
||||
|
||||
test('GET /query/staff/shifts/:shiftId returns injected shift detail', async () => {
|
||||
const app = createApp({ mobileQueryService: createMobileQueryService() });
|
||||
const res = await request(app)
|
||||
|
||||
Reference in New Issue
Block a user