fix: 统一商务表格展示并修正筛选和全量排序
This commit is contained in:
@@ -102,6 +102,24 @@ func TestAnalyticsFiltersKeepHierarchyAndSnapshotNames(t *testing.T) {
|
||||
t.Fatal("不能用当前游戏表名替代报表快照过滤")
|
||||
}
|
||||
}
|
||||
|
||||
func TestAnalyticsChannelSearchMatchesNicknameAndKeepsScope(t *testing.T) {
|
||||
db, repo, scope, filter := prepareAnalyticsData(t)
|
||||
if err := db.Exec("UPDATE tab_promote SET nickname='同名推广' WHERE id=100").Error; err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
scope.Viewer = business.UserScope{SelfID: 9, OnlySelf: true}
|
||||
filter.PromoteName = "推广"
|
||||
data, err := repo.Aggregate(context.Background(), business.ChannelAnalytics, scope, filter)
|
||||
if err != nil || len(data.Rows) != 1 || data.Rows[0].SourceDB != "lx" || data.Rows[0].ID != 100 {
|
||||
t.Fatalf("nickname search must remain scoped: %+v %v", data, err)
|
||||
}
|
||||
filter.PromoteName = "%"
|
||||
data, err = repo.Aggregate(context.Background(), business.ChannelAnalytics, scope, filter)
|
||||
if err != nil || len(data.Rows) != 0 {
|
||||
t.Fatal("wildcard keyword must not broaden the query")
|
||||
}
|
||||
}
|
||||
func TestAnalyticsMissingScopeAndTablesDoNotBroaden(t *testing.T) {
|
||||
db, repo, scope, filter := prepareAnalyticsData(t)
|
||||
scope.IncludeSub = false
|
||||
|
||||
Reference in New Issue
Block a user