36 lines
1.3 KiB
PHP
36 lines
1.3 KiB
PHP
<?php
|
|
|
|
namespace Tests\Feature\Business;
|
|
|
|
use App\Models\Auth\Permission;
|
|
use Tests\Feature\FeatureTestCase;
|
|
|
|
class CourierFreightReconciliationPageTest extends FeatureTestCase
|
|
{
|
|
public function test_retired_freight_reconciliation_is_removed_from_both_courier_directories(): void
|
|
{
|
|
$this->user->attachPermission(Permission::where('name', 'read-admin-panel')->firstOrFail());
|
|
$this->loginAs()->withExceptionHandling();
|
|
|
|
foreach (['courier-payables', 'courier-payables-final'] as $section) {
|
|
$directory = route('business.pages.show', ['section' => $section]);
|
|
|
|
$this->get($directory)
|
|
->assertOk()
|
|
->assertDontSeeText('运费对账')
|
|
->assertSee(route('business.pages.show', ['section' => $section, 'page' => 'shipping-data']), false);
|
|
|
|
$this->from($directory)->get(route('business.pages.show', [
|
|
'section' => $section,
|
|
'page' => 'freight-reconciliation',
|
|
]))->assertRedirect($directory);
|
|
|
|
$this->getJson(route('business.pages.show', [
|
|
'section' => $section,
|
|
'page' => 'freight-reconciliation',
|
|
'courier_summary' => 1,
|
|
]), ['X-Requested-With' => 'XMLHttpRequest'])->assertNotFound();
|
|
}
|
|
}
|
|
}
|