|
15 | 15 |
|
16 | 16 | it 'has basic properties' do
|
17 | 17 | expect(properties["UserPoolName"]).to eq({"Fn::Sub"=>"${EnvironmentName}-test-user-pool"})
|
18 |
| - expect(properties["AutoVerifiedAttributes"]).to include("email") |
19 |
| - expect(properties["MfaConfiguration"]).to eq("ON") |
20 |
| - end |
21 |
| - |
22 |
| - it 'has password policy' do |
23 |
| - policy = properties["Policies"]["PasswordPolicy"] |
24 |
| - expect(policy["MinimumLength"]).to eq(8) |
25 |
| - expect(policy["RequireLowercase"]).to be true |
26 |
| - expect(policy["RequireNumbers"]).to be true |
27 |
| - expect(policy["RequireSymbols"]).to be true |
28 |
| - expect(policy["RequireUppercase"]).to be true |
| 18 | + expect(properties["AliasAttributes"]).to include("email") |
29 | 19 | end
|
30 | 20 |
|
31 | 21 | it 'has schema attributes' do
|
32 | 22 | schema = properties["Schema"]
|
33 | 23 | expect(schema).to include(
|
34 | 24 | {
|
35 | 25 | "Name" => "email",
|
| 26 | + "AttributeDataType" => "String", |
| 27 | + "Required" => true, |
| 28 | + "Mutable" => true |
| 29 | + } |
| 30 | + ) |
| 31 | + expect(schema).to include( |
| 32 | + { |
| 33 | + "Name" => "name", |
| 34 | + "AttributeDataType" => "String", |
36 | 35 | "Required" => true,
|
37 |
| - "Mutable" => true, |
38 |
| - "StringAttributeConstraints" => { |
39 |
| - "MinLength" => "0", |
40 |
| - "MaxLength" => "2048" |
41 |
| - } |
| 36 | + "Mutable" => true |
42 | 37 | }
|
43 | 38 | )
|
44 | 39 | end
|
45 | 40 | end
|
46 | 41 |
|
47 |
| - context 'Resource IdentityPool' do |
48 |
| - let(:properties) { template["Resources"]["IdentityPool"]["Properties"] } |
| 42 | + context 'Resource UserPoolClient' do |
| 43 | + let(:properties) { template["Resources"]["UserPoolClient"]["Properties"] } |
49 | 44 |
|
50 | 45 | it 'has basic properties' do
|
51 |
| - expect(properties["IdentityPoolName"]).to eq({"Fn::Sub"=>"${EnvironmentName}-test-identity-pool"}) |
52 |
| - expect(properties["AllowUnauthenticatedIdentities"]).to be false |
| 46 | + expect(properties["ClientName"]).to eq({"Fn::Sub"=>"${EnvironmentName}-test-client"}) |
| 47 | + expect(properties["GenerateSecret"]).to be true |
| 48 | + expect(properties["UserPoolId"]).to eq({"Ref"=>"UserPool"}) |
53 | 49 | end
|
54 | 50 |
|
55 |
| - it 'has cognito identity providers' do |
56 |
| - providers = properties["CognitoIdentityProviders"] |
57 |
| - expect(providers).to include( |
58 |
| - { |
59 |
| - "ClientId" => "test-client", |
60 |
| - "ProviderName" => "test-provider", |
61 |
| - "ServerSideTokenCheck" => true |
62 |
| - } |
63 |
| - ) |
| 51 | + it 'has oauth configuration' do |
| 52 | + expect(properties["AllowedOAuthScopes"]).to include("openid", "profile") |
| 53 | + expect(properties["CallbackURLs"]).to include("http://localhost:3000") |
| 54 | + expect(properties["LogoutURLs"]).to include("http://localhost:3000/logout") |
| 55 | + expect(properties["DefaultRedirectURI"]).to eq("http://localhost:3000/") |
| 56 | + expect(properties["AllowedOAuthFlows"]).to include("client_credentials") |
| 57 | + expect(properties["AllowedOAuthFlowsUserPoolClient"]).to be true |
| 58 | + end |
| 59 | + end |
| 60 | + |
| 61 | + context 'Resource UserGroup' do |
| 62 | + let(:properties) { template["Resources"]["UserGroupDefault"]["Properties"] } |
| 63 | + |
| 64 | + it 'has basic properties' do |
| 65 | + expect(properties["GroupName"]).to eq("default_group") |
| 66 | + expect(properties["Description"]).to eq("Default user group") |
| 67 | + expect(properties["Precedence"]).to eq(10) |
| 68 | + expect(properties["UserPoolId"]).to eq({"Ref"=>"UserPool"}) |
64 | 69 | end
|
65 | 70 | end
|
66 | 71 |
|
|
73 | 78 | )
|
74 | 79 | end
|
75 | 80 |
|
76 |
| - it 'has identity pool id' do |
77 |
| - expect(outputs["IdentityPoolId"]).to include( |
78 |
| - "Value" => {"Ref"=>"IdentityPool"} |
| 81 | + it 'has user pool client id' do |
| 82 | + expect(outputs["UserPoolClientId"]).to include( |
| 83 | + "Value" => {"Ref"=>"UserPoolClient"} |
79 | 84 | )
|
80 | 85 | end
|
81 | 86 | end
|
|
0 commit comments