Skip to content

Commit

Permalink
fix: update unit test snapshots
Browse files Browse the repository at this point in the history
  • Loading branch information
ansgarm committed Jul 28, 2023
1 parent 208636b commit c14dbd8
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 16 deletions.
10 changes: 5 additions & 5 deletions packages/cdktf/test/fqn.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ test("works when escape is mid-way", () => {
name: "${test_resource.first-resource}-second",
tags: {
firstResourceName:
'simple-test-${lookup(test_resource.other-resource, "name", "")}-${test_resource.first-resource.name}',
"simple-test-${test_resource.other-resource.name}-${test_resource.first-resource.name}",
},
};

Expand Down Expand Up @@ -147,7 +147,7 @@ test("after escape, reverts to normal", () => {
name: "${test_resource.first-resource}-second",
tags: {
firstResourceName:
'simple-test-${test_resource.first-resource.name}-${lookup(test_resource.other-resource, "name", "")}',
"simple-test-${test_resource.first-resource.name}-${test_resource.other-resource.name}",
},
};

Expand Down Expand Up @@ -186,7 +186,7 @@ test("can have multiple escapes", () => {
name: "${test_resource.first-resource}-second",
tags: {
firstResourceName:
'simple-test-${test_resource.first-resource.name}-${lookup(test_resource.other-resource, "name", "")}',
"simple-test-${test_resource.first-resource.name}-${test_resource.other-resource.name}",
},
};

Expand Down Expand Up @@ -291,7 +291,7 @@ test("works with functions", () => {
name: "${test_resource.first-resource}-second",
tags: {
firstResourceName:
'simple-test-${test_resource.first-resource.name}-${lookup(test_resource.other-resource, "name", "")}',
"simple-test-${test_resource.first-resource.name}-${test_resource.other-resource.name}",
},
};

Expand Down Expand Up @@ -416,7 +416,7 @@ test("allows functions within functions", () => {
name: "bar",
tags: {
firstResourceName:
'${lookup(test_resource.other-resource, "name", upper(lookup(test_resource.other-resource, "name", "")))}',
'${lookup(test_resource.other-resource, "name", upper(test_resource.other-resource.name))}',
},
};

Expand Down
20 changes: 10 additions & 10 deletions packages/cdktf/test/functions.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -574,20 +574,20 @@ test("Property access using lookup and lookupNested functions", () => {

expect(Testing.synth(stack)).toMatchInlineSnapshot(`
"{
\\"output\\": {
\\"lookup\\": {
\\"value\\": \\"\${lookup(var.test-var, \\\\\\"z\\\\\\", \\\\\\"defaultzzzz\\\\\\")}\\"
"output": {
"lookup": {
"value": "\${lookup(var.test-var, \\"z\\", \\"defaultzzzz\\")}"
},
\\"native-access\\": {
\\"value\\": \\"\${var.test-var[\\\\\\"z\\\\\\"]}\\"
"native-access": {
"value": "\${var.test-var.z}"
},
\\"native-access-nested\\": {
\\"value\\": \\"\${var.test-var[\\\\\\"a\\\\\\"][\\\\\\"b\\\\\\"]}\\"
"native-access-nested": {
"value": "\${var.test-var.a.b}"
}
},
\\"variable\\": {
\\"test-var\\": {
\\"type\\": \\"object({a = object({b = string}), z = string})\\"
"variable": {
"test-var": {
"type": "object({a = object({b = string}), z = string})"
}
}
}"
Expand Down
2 changes: 1 addition & 1 deletion packages/cdktf/test/iterator.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ test("iterator access nested types", () => {
);
expect(synth.resource.test_resource.test.tags).toMatchInlineSnapshot(`
{
"boolean_map": "\${lookup(each.value.map, "a", false)}",
"boolean_map": "\${each.value.map.a}",
"list": "\${join(",", each.value.list_attribute)}",
"map": "\${lookup(each.value.map, "a", "default")}",
"number": "\${tostring(each.value.number_attribute)}",
Expand Down

0 comments on commit c14dbd8

Please sign in to comment.