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

Increase test coverage for actions #679

Merged
merged 1 commit into from
Mar 17, 2023
Merged

Conversation

sergiught
Copy link
Contributor

@sergiught sergiught commented Mar 16, 2023

🔧 Changes

Mainly expand test coverage on the actions commands, however a couple of modest improvements were made as well. More details below in the comments.

📚 References

🔬 Testing

Commander + unit tests.

📝 Checklist

  • All new/changed/fixed functionality is covered by tests (or N/A)
  • I have added documentation for all new/changed functionality (or N/A)

@sergiught sergiught force-pushed the patch/DXCDT-408-action-test branch from e103fe4 to f0e5536 Compare March 16, 2023 18:59
@@ -25,7 +25,7 @@ auth0 actions update [flags]
auth0 actions update <action-id> --name myaction --code "$(cat path/to/code.js)" --dependency "lodash=4.0.0"
auth0 actions update <action-id> --name myaction --code "$(cat path/to/code.js)" --dependency "lodash=4.0.0" --secret "SECRET=value"
auth0 actions update <action-id> --name myaction --code "$(cat path/to/code.js)" --dependency "lodash=4.0.0" --dependency "uuid=9.0.0" --secret "API_KEY=value" --secret "SECRET=value"
auth0 actions update <action-id> -n myaction -t post-login -c "$(cat path/to/code.js)" -d "lodash=4.0.0" -d "uuid=9.0.0" -s "API_KEY=value" -s "SECRET=value" --json
Copy link
Contributor Author

Choose a reason for hiding this comment

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

We can't update the triggers once set, this was flawed within the docs.

Comment on lines -399 to -402
_, err := cli.api.Action.Read(inputs.ID)
if err != nil {
return fmt.Errorf("Unable to delete action: %w", err)
}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

It didn't make any sense to do a read and then a delete. The delete will throw an error if the action doesn't exist, e.g.

Deleting action... failed

=== example.eu.auth0.com error

 ▸    404 Not Found: That action does not exist.

@sergiught sergiught force-pushed the patch/DXCDT-408-action-test branch from f0e5536 to 41da089 Compare March 16, 2023 19:02
@sergiught sergiught marked this pull request as ready for review March 16, 2023 19:07
@sergiught sergiught requested a review from a team as a code owner March 16, 2023 19:07
@sergiught sergiught merged commit 5fb7796 into main Mar 17, 2023
@sergiught sergiught deleted the patch/DXCDT-408-action-test branch March 17, 2023 10:44
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.

2 participants