feat: 增加顺运宝店铺筛选 (#151)
This commit is contained in:
@@ -88,14 +88,14 @@ func TestSybRedirectAfterStart_清除本次日期范围(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestSybHistoryPagination_保留筛选并重开弹窗(t *testing.T) {
|
||||
view := sybHistoryPagination(2, 3, "ORDER-1", "2026-08-01", "2026-08-09")
|
||||
view := sybHistoryPagination(2, 3, "ORDER-1", "店铺A", "pdd_missing", "2026-08-01", "2026-08-09")
|
||||
for _, raw := range []string{view.FirstURL, view.PrevURL, view.NextURL, view.LastURL} {
|
||||
location, err := url.Parse(raw)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
query := location.Query()
|
||||
if query.Get("history") != "1" || query.Get("order_no") != "ORDER-1" ||
|
||||
if query.Get("history") != "1" || query.Get("order_no") != "ORDER-1" || query.Get("shop") != "店铺A" || query.Get("stage") != "pdd_missing" ||
|
||||
query.Get("date_from") != "2026-08-01" || query.Get("date_to") != "2026-08-09" {
|
||||
t.Fatalf("同步记录翻页链接丢失页面状态: %s", raw)
|
||||
}
|
||||
@@ -103,13 +103,14 @@ func TestSybHistoryPagination_保留筛选并重开弹窗(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestSybHistoryURL_刷新时保留当前页和筛选(t *testing.T) {
|
||||
location, err := url.Parse(sybHistoryURL(3, "ORDER-1", "2026-08-01", "2026-08-09"))
|
||||
location, err := url.Parse(sybHistoryURL(3, "ORDER-1", "店铺A", "pdd_missing", "2026-08-01", "2026-08-09"))
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
query := location.Query()
|
||||
for name, want := range map[string]string{
|
||||
"history": "1", "history_page": "3", "order_no": "ORDER-1",
|
||||
"shop": "店铺A", "stage": "pdd_missing",
|
||||
"date_from": "2026-08-01", "date_to": "2026-08-09",
|
||||
} {
|
||||
if got := query.Get(name); got != want {
|
||||
@@ -119,7 +120,7 @@ func TestSybHistoryURL_刷新时保留当前页和筛选(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestSybHistoryPartialURL_只读片段保留当前页和筛选(t *testing.T) {
|
||||
location, err := url.Parse(sybHistoryPartialURL(3, "ORDER-1", "2026-08-01", "2026-08-09"))
|
||||
location, err := url.Parse(sybHistoryPartialURL(3, "ORDER-1", "店铺A", "pdd_missing", "2026-08-01", "2026-08-09"))
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
@@ -129,6 +130,7 @@ func TestSybHistoryPartialURL_只读片段保留当前页和筛选(t *testing.T)
|
||||
query := location.Query()
|
||||
for name, want := range map[string]string{
|
||||
"history_page": "3", "order_no": "ORDER-1",
|
||||
"shop": "店铺A", "stage": "pdd_missing",
|
||||
"date_from": "2026-08-01", "date_to": "2026-08-09",
|
||||
} {
|
||||
if got := query.Get(name); got != want {
|
||||
@@ -138,7 +140,7 @@ func TestSybHistoryPartialURL_只读片段保留当前页和筛选(t *testing.T)
|
||||
}
|
||||
|
||||
func TestSybHistoryPartialPagination_翻页继续使用片段路由(t *testing.T) {
|
||||
view := sybHistoryPartialPagination(2, 3, "ORDER-1", "2026-08-01", "2026-08-09")
|
||||
view := sybHistoryPartialPagination(2, 3, "ORDER-1", "店铺A", "pdd_missing", "2026-08-01", "2026-08-09")
|
||||
for _, raw := range []string{view.FirstURL, view.PrevURL, view.NextURL, view.LastURL} {
|
||||
location, err := url.Parse(raw)
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user