Update ProductsApiTest to use 'user' session for department pricing tests
This commit is contained in:
@@ -47,8 +47,8 @@ it('treats null-like optional product params as omitted for product detail reque
|
||||
expect($response->body)->not->toContain('department_access_0');
|
||||
});
|
||||
|
||||
it('returns final department pricing without requiring department access', function (): void {
|
||||
api_test_covers('GET /products', 'permissions');
|
||||
it('returns final department pricing without requiring list_products permission', function (): void {
|
||||
api_test_covers('GET /products', 'customer-booking');
|
||||
|
||||
$department = api_fixtures()->createDepartment(['name' => 'Product Pricing Department']);
|
||||
$product = api_fixtures()->createProduct([
|
||||
@@ -56,7 +56,7 @@ it('returns final department pricing without requiring department access', funct
|
||||
'price' => 500,
|
||||
]);
|
||||
products_api_department_price((int)$department['id'], (int)$product['id'], 375);
|
||||
$session = api_fixtures()->createUserSession(['list_products']);
|
||||
$session = api_fixtures()->createUserSession(['user']);
|
||||
|
||||
$response = api_client()->get(
|
||||
'/products?final_price=true&id=' . (int)$product['id']
|
||||
@@ -145,7 +145,7 @@ it('rejects invalid department ids without requesting department access zero', f
|
||||
'name' => 'Invalid Department Product',
|
||||
'price' => 600,
|
||||
]);
|
||||
$session = api_fixtures()->createUserSession(['list_products']);
|
||||
$session = api_fixtures()->createUserSession(['user']);
|
||||
|
||||
$response = api_client()->get(
|
||||
'/products?final_price=true&id=' . (int)$product['id'] . '&department_id=0',
|
||||
|
||||
Reference in New Issue
Block a user