Offer 4x6 label downloads alongside A4
Deploy HickLab3D Dashboard / Deploy to production (push) Successful in 1m48s
Deploy HickLab3D Dashboard / Deploy to production (push) Successful in 1m48s
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 5.5
parent
51c6748894
commit
dff81caaea
@@ -210,6 +210,21 @@ class IntegrationsTest extends TestCase
|
||||
Http::assertSent(fn ($request) => str_contains($request->url(), '/labels/123') && str_contains($request->url(), 'hash=link%2Bhash%3D'));
|
||||
}
|
||||
|
||||
public function test_shipping_label_can_be_requested_in_4x6_format(): void
|
||||
{
|
||||
Http::preventStrayRequests();
|
||||
Http::fake([
|
||||
'https://auth.example.test/token' => Http::response(['access_token' => 'test-token']),
|
||||
'https://shipping.example.test/api/me/orders/detail' => Http::response(['Orders' => [['OrderLineId' => 123, 'Hash' => 'order-hash']]]),
|
||||
'https://shipping.example.test/api/labels/123*' => Http::response(['Base64EncodedLabels' => [base64_encode('%PDF-1.4 test label')]]),
|
||||
]);
|
||||
config()->set('services.parcel2go', ['client_id' => 'id', 'client_secret' => 'secret', 'auth_url' => 'https://auth.example.test/token', 'base_url' => 'https://shipping.example.test/api']);
|
||||
|
||||
$this->actingAs(User::factory()->create(['role' => 'admin']))->get(route('shipping.label', [123, 'size' => '4x6']))
|
||||
->assertOk()->assertHeader('content-disposition', 'attachment; filename="parcel2go-123-4x6.pdf"');
|
||||
Http::assertSent(fn ($request) => str_contains($request->url(), '/labels/123') && str_contains($request->url(), 'labelMedia=Label4x6'));
|
||||
}
|
||||
|
||||
public function test_collection_booking_uses_quoted_service_and_available_date(): void
|
||||
{
|
||||
$this->pendingEtsyOrder();
|
||||
|
||||
Reference in New Issue
Block a user