Skip to content

Commit cf7d67e

Browse files
committed
broaden test coverage
1 parent e17bceb commit cf7d67e

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

enterprise/coderd/workspaces_test.go

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1523,6 +1523,32 @@ func TestWorkspaceTagsTerraform(t *testing.T) {
15231523
}
15241524
}`,
15251525
},
1526+
{
1527+
name: "override no tags",
1528+
provisionerTags: map[string]string{"foo": "baz"},
1529+
createTemplateVersionRequestTags: map[string]string{"foo": "baz"},
1530+
tfWorkspaceTags: ``,
1531+
},
1532+
{
1533+
name: "override empty tags",
1534+
provisionerTags: map[string]string{"foo": "baz"},
1535+
createTemplateVersionRequestTags: map[string]string{"foo": "baz"},
1536+
tfWorkspaceTags: `
1537+
data "coder_workspace_tags" "tags" {
1538+
tags = {}
1539+
}`,
1540+
},
1541+
{
1542+
name: "does not override static tag",
1543+
provisionerTags: map[string]string{"foo": "bar"},
1544+
createTemplateVersionRequestTags: map[string]string{"foo": "baz"},
1545+
tfWorkspaceTags: `
1546+
data "coder_workspace_tags" "tags" {
1547+
tags = {
1548+
"foo" = "bar"
1549+
}
1550+
}`,
1551+
},
15261552
} {
15271553
tc := tc
15281554
t.Run(tc.name, func(t *testing.T) {

0 commit comments

Comments
 (0)