@@ -98,10 +98,11 @@ func TestBuildPayload(t *testing.T) {
98
98
99
99
// GIVEN: a set of helpers to be injected into the templates
100
100
const label = "Click here!"
101
- const url = "http://xyz.com/"
101
+ const baseURL = "http://xyz.com"
102
+ const url = baseURL + "/@bobby/my-workspace"
102
103
helpers := map [string ]any {
103
104
"my_label" : func () string { return label },
104
- "my_url" : func () string { return url },
105
+ "my_url" : func () string { return baseURL },
105
106
}
106
107
107
108
// GIVEN: an enqueue interceptor which returns mock metadata
@@ -112,7 +113,7 @@ func TestBuildPayload(t *testing.T) {
112
113
actions := []types.TemplateAction {
113
114
{
114
115
Label : "{{ my_label }}" ,
115
- URL : "{{ my_url }}" ,
116
+ URL : "{{ my_url }}/@{{.UserName}}/{{.Labels.name}} " ,
116
117
},
117
118
}
118
119
out , err := json .Marshal (actions )
@@ -131,7 +132,9 @@ func TestBuildPayload(t *testing.T) {
131
132
require .NoError (t , err )
132
133
133
134
// WHEN: a notification is enqueued
134
- _ , err = enq .Enqueue (ctx , uuid .New (), notifications .TemplateWorkspaceDeleted , nil , "test" )
135
+ _ , err = enq .Enqueue (ctx , uuid .New (), notifications .TemplateWorkspaceDeleted , map [string ]string {
136
+ "name" : "my-workspace" ,
137
+ }, "test" )
135
138
require .NoError (t , err )
136
139
137
140
// THEN: expect that a payload will be constructed and have the expected values
0 commit comments