Skip to content

Commit

Permalink
Fix unit tests and lint
Browse files Browse the repository at this point in the history
  • Loading branch information
ramya18101 committed Dec 20, 2024
1 parent 697a07b commit fb5a32d
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 24 deletions.
13 changes: 7 additions & 6 deletions management/prompt_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ func TestPromptManager_ReadRendering(t *testing.T) {
assert.Equal(t, ScreenSignup, *actual.GetScreen())
}

// Able to update the renderingMode to advanced and the setting configs when parsing the advanced renderingMode in payload
// Able to update the renderingMode to advanced and the setting configs when parsing the advanced renderingMode in payload.
func TestPromptManager_UpdateRenderingWithAdvancedMode(t *testing.T) {
configureHTTPTestRecordings(t)

Expand All @@ -168,7 +168,7 @@ func TestPromptManager_UpdateRenderingWithAdvancedMode(t *testing.T) {
assert.Equal(t, ScreenSignup, *actual.GetScreen())
}

// Unable to update the setting configs and only able to update the renderingMode to standard when parsing the standard renderingMode in payload
// Unable to update the setting configs and only able to update the renderingMode to standard when parsing the standard renderingMode in payload.
func TestPromptManager_UpdateRenderingWithStandardMode(t *testing.T) {
configureHTTPTestRecordings(t)

Expand All @@ -187,15 +187,16 @@ func TestPromptManager_UpdateRenderingWithStandardMode(t *testing.T) {

actual, err := api.Prompt.ReadRendering(context.Background(), PromptSignup, ScreenSignup)
assert.NoError(t, err)
assert.Equal(t, expected.GetRenderingMode(), actual.GetRenderingMode())
assert.NotEqual(t, expected.GetContextConfiguration(), actual.GetContextConfiguration())
assert.NotEqual(t, expected.GetDefaultHeadTagsDisabled(), actual.GetDefaultHeadTagsDisabled())

assert.Equal(t, updateData.GetRenderingMode(), actual.GetRenderingMode())
assert.NotEqual(t, updateData.GetContextConfiguration(), actual.GetContextConfiguration())
assert.NotEqual(t, updateData.GetDefaultHeadTagsDisabled(), actual.GetDefaultHeadTagsDisabled())
assert.Equal(t, expected.HeadTags, actual.HeadTags)
assert.Equal(t, PromptSignup, *actual.GetPrompt())
assert.Equal(t, ScreenSignup, *actual.GetScreen())
}

// Able to update the setting's configs even the existing renderingMode is standard since renderingMode is not parsed in payload(updateData)
// Able to update the setting's configs even the existing renderingMode is standard since renderingMode is not parsed in payload(updateData).
func TestPromptManager_UpdateRendering(t *testing.T) {
configureHTTPTestRecordings(t)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ interactions:
{"domain":"1734698728.auth.uat.auth0.com","type":"auth0_managed_certs","tls_policy":"recommended"}
form: {}
headers:
Content-Type:
- application/json
User-Agent:
- Go-Auth0/1.13.0
Content-Type:
- application/json
User-Agent:
- Go-Auth0/1.13.0
url: https://go-auth0-dev.eu.auth0.com/api/v2/custom-domains
method: POST
response:
Expand All @@ -28,12 +28,12 @@ interactions:
proto_minor: 0
transfer_encoding: []
trailer: {}
content_length: 342
content_length: 169
uncompressed: false
body: '{"custom_domain_id":"cd_hW5C18CQPXRsKpDz","domain":"1733383424.auth.uat.auth0.com","primary":true,"status":"pending_verification","type":"auth0_managed_certs","verification":{"methods":[{"name":"CNAME","record":"go-auth0-dev.eu.auth0.com-cd-hw5c18cqpxrskpdz.edge.tenants.us.auth0.com","domain":"1733383424.auth.uat.auth0.com"}]},"tls_policy":"recommended"}'
headers:
Content-Type:
- application/json; charset=utf-8
Content-Type:
- application/json; charset=utf-8
status: 201 Created
code: 201
duration: 994.566333ms
Expand Down Expand Up @@ -72,7 +72,7 @@ interactions:
- application/json; charset=utf-8
status: 201 Created
code: 201
duration: 2.057963083s
duration: 1.247840334s
- id: 2
request:
proto: HTTP/1.1
Expand Down Expand Up @@ -108,7 +108,7 @@ interactions:
- application/json; charset=utf-8
status: 200 OK
code: 200
duration: 1.022270875s
duration: 894.029792ms
- id: 3
request:
proto: HTTP/1.1
Expand Down Expand Up @@ -144,7 +144,7 @@ interactions:
- application/json; charset=utf-8
status: 200 OK
code: 200
duration: 1.863281333s
duration: 900.59625ms
- id: 4
request:
proto: HTTP/1.1
Expand Down Expand Up @@ -179,7 +179,7 @@ interactions:
- application/json; charset=utf-8
status: 200 OK
code: 200
duration: 1.830981625s
duration: 952.041666ms
- id: 5
request:
proto: HTTP/1.1
Expand Down Expand Up @@ -214,7 +214,7 @@ interactions:
- application/json; charset=utf-8
status: 204 No Content
code: 204
duration: 1.763990917s
duration: 921.355709ms
- id: 6
request:
proto: HTTP/1.1
Expand All @@ -229,10 +229,10 @@ interactions:
body: ""
form: {}
headers:
Content-Type:
- application/json
User-Agent:
- Go-Auth0/1.13.0
Content-Type:
- application/json
User-Agent:
- Go-Auth0/1.13.0
url: https://go-auth0-dev.eu.auth0.com/api/v2/custom-domains/cd_hW5C18CQPXRsKpDz
method: DELETE
response:
Expand All @@ -245,8 +245,8 @@ interactions:
uncompressed: false
body: ""
headers:
Content-Type:
- application/json; charset=utf-8
Content-Type:
- application/json; charset=utf-8
status: 204 No Content
code: 204
duration: 411.741083ms

0 comments on commit fb5a32d

Please sign in to comment.