This commit is contained in:
@@ -70,6 +70,21 @@ test('archives selected admin inventory items through the bulk API', async () =>
|
||||
}
|
||||
});
|
||||
|
||||
test('fetches an admin inventory export job through the bulk job API', async () => {
|
||||
const originalFetch = globalThis.fetch;
|
||||
globalThis.fetch = async (url, options) => {
|
||||
assert.equal(url, '/api/v1/admin/exports/jobs/job-1');
|
||||
return { ok: true, async json() { return { data: { id: 'job-1', status: 'COMPLETED' } }; } };
|
||||
};
|
||||
|
||||
try {
|
||||
const { getAdminInventoryExportJob } = await import('../src/services/admin-catalog-service.js');
|
||||
assert.deepEqual(await getAdminInventoryExportJob('job-1'), { id: 'job-1', status: 'COMPLETED' });
|
||||
} finally {
|
||||
globalThis.fetch = originalFetch;
|
||||
}
|
||||
});
|
||||
|
||||
test('enqueues selected admin inventory pricing refreshes through the bulk API', async () => {
|
||||
const originalFetch = globalThis.fetch;
|
||||
globalThis.fetch = async (url, options) => {
|
||||
|
||||
Reference in New Issue
Block a user