From d12b186a69f1d5f723f6bdf929b7f86a6b5cb355 Mon Sep 17 00:00:00 2001 From: MHSanaei Date: Sat, 27 Jun 2026 13:56:45 +0200 Subject: [PATCH] test(sub): align identity-token test with first-link-only EMAIL 876d55f2 made {{EMAIL}}/{{USERNAME}} appear on the first sub-body link only, but TestIdentityTokensEverywhere still asserted the email survived on every repeat body link, breaking the go-test and race CI jobs. Update it to assert the repeat body link drops the identity token while the display/QR remark keeps it; the first-link case is covered by TestEmailOnFirstLinkOnly. --- internal/sub/remark_vars_test.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/internal/sub/remark_vars_test.go b/internal/sub/remark_vars_test.go index 12125c144..eb254e957 100644 --- a/internal/sub/remark_vars_test.go +++ b/internal/sub/remark_vars_test.go @@ -361,7 +361,7 @@ func TestConnectionTokensDisplayContextUnchanged(t *testing.T) { } } -func TestIdentityTokensEverywhere(t *testing.T) { +func TestIdentityTokenBodyVsDisplay(t *testing.T) { const tmpl = "{{INBOUND}}|📊{{TRAFFIC_LEFT}}|{{EMAIL}}" inbound := &model.Inbound{ Remark: "DE", @@ -373,8 +373,8 @@ func TestIdentityTokensEverywhere(t *testing.T) { body := &SubService{remarkTemplate: tmpl, subscriptionBody: true, usageShown: map[string]bool{}} _ = body.genTemplatedRemark(inbound, client, "", "ws") // first link consumes the usage block - if second := body.genTemplatedRemark(inbound, client, "", "ws"); !strings.Contains(second, "john@x") { - t.Fatalf("repeat body link %q must keep the identity token", second) + if second := body.genTemplatedRemark(inbound, client, "", "ws"); strings.Contains(second, "john@x") { + t.Fatalf("repeat body link %q must drop the identity token", second) } display := &SubService{remarkTemplate: tmpl, subscriptionBody: false}