Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add show_as_button to organizations connection #706

Merged
merged 8 commits into from
Apr 2, 2024

Conversation

jpealing-fiscaltec
Copy link
Contributor

Changes

Adds show_as_button to OrganizationConnection, OrganizationConnectionCreateRequest and OrganizationConnectionUpdateRequest.

References

This property is documented here:

Testing

I have attempted to add a unit test by following the pattern used for AssignMembershipOnLogin, however I was not able to run the tests to validate that they passed.

  • This change adds unit test coverage

  • This change adds integration test coverage

  • This change has been tested on the latest version of the platform/language or why not

Checklist

Copy link
Member

@frederikprijck frederikprijck left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the contribution 🔥

@@ -152,26 +152,31 @@ public async Task Test_organization_connections_crud_sequence()
var createConnectionResponse = await fixture.ApiClient.Organizations.CreateConnectionAsync(ExistingOrganizationId, new OrganizationConnectionCreateRequest
{
ConnectionId = ExistingConnectionId,
AssignMembershipOnLogin = true
AssignMembershipOnLogin = true,
ShowAsButton = true
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

show_as_button defaults to true on the API, can we remove this line to ensure the default value is used when omitted?

Copy link
Contributor Author

@jpealing-fiscaltec jpealing-fiscaltec Mar 19, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've removed that line and also removed the equivalent in the update call so there is a test for backwards compatability, as well as making ShowAsButton nullable on OrganizationConnectionUpdateRequest and OrganizationConnectionCreateRequest. This means Test_organization_connections_crud_sequence no longer tests creates and updates with ShowAsButton set, so I've added Test_organization_connections_show_as_button_crud_sequence as an attempt to test this, or would you prefer this be tested by extending Test_organization_connections_crud_sequence?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See #706 (comment), I think we can stick to that.

jpealing-fiscaltec and others added 5 commits March 19, 2024 09:33
To verify that the default value of "true" is used.
`Test_organization_connections_show_as_button_crud_sequence` to test creates and updates with `ShowAsButton` set.
// Unlink Connection
await fixture.ApiClient.Organizations.DeleteConnectionAsync(ExistingOrganizationId, ExistingConnectionId);
}
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we can avoid this test, and instead use the original to:

  • Leave the default on create and assert its true
  • Set it to false on update and assert its false after

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@frederikprijck
Copy link
Member

Thanks 👍 Ignore the failing CI, will look into it. PR looks good 🙏 🔥

@jpealing-fiscaltec
Copy link
Contributor Author

Any update on when this is likely to be merged?

@frederikprijck
Copy link
Member

Sorry, lost track of this. Let me fix CI and look into merging and releasing this.

@frederikprijck
Copy link
Member

Tests are failing because the property is only supported for Enterprise Connections. I will revert the changes to the test and move forward without the tests, testing enterprise-only features are not always that trivial.

@frederikprijck frederikprijck merged commit ede4657 into auth0:master Apr 2, 2024
16 of 17 checks passed
@frederikprijck frederikprijck mentioned this pull request Apr 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants