This commit is contained in:
@@ -69,6 +69,9 @@ function createTestApp({ authenticateAdmin, authorizeUnsafeRequest, pricingServi
|
||||
return item;
|
||||
});
|
||||
},
|
||||
async updateProductTagsByIdsForSeller() {
|
||||
return [];
|
||||
},
|
||||
},
|
||||
pricingService,
|
||||
}),
|
||||
@@ -248,6 +251,44 @@ test('enqueues selected inventory pricing refreshes through the bulk route', asy
|
||||
assert.equal(response.json().data[0].status, 'PENDING');
|
||||
});
|
||||
|
||||
test('updates Product tags through the authenticated bulk route', async (testContext) => {
|
||||
const app = createTestApp({
|
||||
authenticateAdmin: async () => ({ sellerId: 'b078adf4-6a91-4b3d-a263-740246c11e3f' }),
|
||||
});
|
||||
testContext.after(() => app.close());
|
||||
|
||||
const productResponse = await app.inject({
|
||||
method: 'POST',
|
||||
url: '/api/v1/admin/products',
|
||||
payload: {
|
||||
name: 'Pikachu Plush',
|
||||
categoryId: 'ab8150c7-96c1-4b55-8d69-7d0b77d48958',
|
||||
tags: ['Keep'],
|
||||
},
|
||||
});
|
||||
await app.inject({
|
||||
method: 'POST',
|
||||
url: '/api/v1/admin/inventory',
|
||||
payload: {
|
||||
productId: productResponse.json().data.id,
|
||||
conditionId: '21eb218b-7a95-4f80-a9e3-e306f7ca1f2e',
|
||||
},
|
||||
});
|
||||
const response = await app.inject({
|
||||
method: 'POST',
|
||||
url: '/api/v1/admin/bulk',
|
||||
payload: {
|
||||
action: 'TAGS',
|
||||
inventoryItemIds: ['8a0a836a-a597-454d-8c5e-e146d27dbbf2'],
|
||||
add: ['Binder'],
|
||||
remove: ['sell'],
|
||||
},
|
||||
});
|
||||
|
||||
assert.equal(response.statusCode, 200);
|
||||
assert.deepEqual(response.json().data, []);
|
||||
});
|
||||
|
||||
test('rejects an authenticated product write without a CSRF token', async (testContext) => {
|
||||
const app = createTestApp({
|
||||
authenticateAdmin: async () => ({ sellerId: 'b078adf4-6a91-4b3d-a263-740246c11e3f' }),
|
||||
|
||||
@@ -50,6 +50,7 @@ test('returns a public product without private seller identity', async (testCont
|
||||
cardNumber: null,
|
||||
eventName: null,
|
||||
releaseYear: null,
|
||||
tags: [],
|
||||
createdAt: '2026-09-07T00:00:00.000Z',
|
||||
updatedAt: '2026-09-07T00:00:00.000Z',
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user