Skip to content

Commit 6bc44a0

Browse files
committed
Correct expectations from broken test, and add test to verify #924 is indeed fixed
1 parent 769c28b commit 6bc44a0

File tree

4 files changed

+28
-62
lines changed

4 files changed

+28
-62
lines changed

Diff for: packages/@aws-cdk/aws-codepipeline/test/integ.lambda-pipeline.expected.json

+6-16
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,12 @@
4444
"Arn"
4545
]
4646
},
47+
{
48+
"Fn::GetAtt": [
49+
"PipelineBucketB967BD35",
50+
"Arn"
51+
]
52+
},
4753
{
4854
"Fn::Join": [
4955
"",
@@ -57,22 +63,6 @@
5763
"/*"
5864
]
5965
]
60-
}
61-
]
62-
},
63-
{
64-
"Effect": "Allow",
65-
"Action": [
66-
"s3:GetBucket*",
67-
"s3:GetObject*",
68-
"s3:List*"
69-
],
70-
"Resource": [
71-
{
72-
"Fn::GetAtt": [
73-
"PipelineBucketB967BD35",
74-
"Arn"
75-
]
7666
},
7767
{
7868
"Fn::Join": [

Diff for: packages/@aws-cdk/aws-codepipeline/test/integ.pipeline-cfn.expected.json

+6-16
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,12 @@
4444
"Arn"
4545
]
4646
},
47+
{
48+
"Fn::GetAtt": [
49+
"PipelineBucketB967BD35",
50+
"Arn"
51+
]
52+
},
4753
{
4854
"Fn::Join": [
4955
"",
@@ -57,22 +63,6 @@
5763
"/*"
5864
]
5965
]
60-
}
61-
]
62-
},
63-
{
64-
"Effect": "Allow",
65-
"Action": [
66-
"s3:GetBucket*",
67-
"s3:GetObject*",
68-
"s3:List*"
69-
],
70-
"Resource": [
71-
{
72-
"Fn::GetAtt": [
73-
"PipelineBucketB967BD35",
74-
"Arn"
75-
]
7666
},
7767
{
7868
"Fn::Join": [

Diff for: packages/@aws-cdk/aws-codepipeline/test/integ.pipeline-code-deploy.expected.json

-30
Original file line numberDiff line numberDiff line change
@@ -118,36 +118,6 @@
118118
}
119119
]
120120
},
121-
{
122-
"Effect": "Allow",
123-
"Action": [
124-
"s3:GetBucket*",
125-
"s3:GetObject*",
126-
"s3:List*"
127-
],
128-
"Resource": [
129-
{
130-
"Fn::GetAtt": [
131-
"CodeDeployPipelineIntegTest9F618D61",
132-
"Arn"
133-
]
134-
},
135-
{
136-
"Fn::Join": [
137-
"",
138-
[
139-
{
140-
"Fn::GetAtt": [
141-
"CodeDeployPipelineIntegTest9F618D61",
142-
"Arn"
143-
]
144-
},
145-
"/*"
146-
]
147-
]
148-
}
149-
]
150-
},
151121
{
152122
"Effect": "Allow",
153123
"Action": [

Diff for: packages/@aws-cdk/aws-iam/test/test.policy-document.ts

+16
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,22 @@ export = {
140140
test.done();
141141
},
142142

143+
'addAccountPrincipal can be used multiple times'(test: Test) {
144+
const p = new PolicyStatement();
145+
p.addAwsAccountPrincipal('1234');
146+
p.addAwsAccountPrincipal('5678'),
147+
test.deepEqual(resolve(p), {
148+
Effect: 'Allow',
149+
Principal: {
150+
AWS: [
151+
{ 'Fn::Join': ['', ['arn:', { Ref: 'AWS::Partition' }, ':iam::1234:root']] },
152+
{ 'Fn::Join': ['', ['arn:', { Ref: 'AWS::Partition' }, ':iam::5678:root']] }
153+
]
154+
}
155+
});
156+
test.done();
157+
},
158+
143159
'hasResource': {
144160
'false if there are no resources'(test: Test) {
145161
test.equal(new PolicyStatement().hasResource, false, 'hasResource should be false for an empty permission');

0 commit comments

Comments
 (0)