test: 同步失败原因重试链接应清除fail_only(从fail_only入口模拟)
This commit is contained in:
@@ -64,16 +64,26 @@ class AdminPlatformOrderSyncFailedReasonTop5RetryLinkTest extends TestCase
|
|||||||
],
|
],
|
||||||
]);
|
]);
|
||||||
|
|
||||||
$page = $this->get('/admin/platform-orders');
|
// 先模拟:从“只看同步失败(fail_only=1)”进入
|
||||||
|
$page = $this->get('/admin/platform-orders?fail_only=1');
|
||||||
$page->assertOk();
|
$page->assertOk();
|
||||||
|
|
||||||
// 失败原因链接存在
|
// 失败原因链接存在
|
||||||
$page->assertSee('sync_status=failed', false);
|
$page->assertSee('sync_status=failed', false);
|
||||||
$page->assertSee('sync_error_keyword=', false);
|
$page->assertSee('sync_error_keyword=', false);
|
||||||
|
|
||||||
// “切到可同步重试”链接存在:应包含 syncable_only=1,并不应包含 sync_status=failed
|
// “切到可同步重试”链接存在:
|
||||||
|
// - 应包含 syncable_only=1
|
||||||
|
// - 且必须清掉 fail_only=1 与 sync_status=failed(注意:页面其它区域可能仍包含 fail_only=1&syncable_only=1 的统计链接,因此这里要针对“重试链接”本身断言)
|
||||||
$page->assertSee('切到可同步重试');
|
$page->assertSee('切到可同步重试');
|
||||||
$page->assertSee('syncable_only=1', false);
|
|
||||||
|
$retryHref = '/admin/platform-orders?sync_error_keyword=' . urlencode('模拟失败原因TOP5') . '&sync_status=unsynced&syncable_only=1';
|
||||||
|
$page->assertSee($retryHref, false);
|
||||||
|
|
||||||
|
// 不应出现“带 fail_only=1 的重试链接”
|
||||||
|
$page->assertDontSee('/admin/platform-orders?fail_only=1&sync_error_keyword=' . urlencode('模拟失败原因TOP5') . '&sync_status=unsynced&syncable_only=1', false);
|
||||||
|
|
||||||
|
// 也不应出现“sync_status=failed + syncable_only=1”的冲突组合
|
||||||
$page->assertDontSee('sync_status=failed&syncable_only=1', false);
|
$page->assertDontSee('sync_status=failed&syncable_only=1', false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user