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

test: add tests focusing on workflow run outputs, document and facial similarity reports #109

Merged
merged 2 commits into from
May 2, 2024

Conversation

sofia-gomes-onfido
Copy link
Contributor

@sofia-gomes-onfido sofia-gomes-onfido commented Mar 22, 2024

Add tests for workflow run outputs.

The output field of workflow runs is configured within Studio workflow builder and can yield anything the client configures.
The tests added validate there are no schema errors when the output is configured to be the result of a Profile Data Capture task, of a Document Report and of a Facial Similarity Photo Report.

I've also added tests validating the outcome of Document and Facial Similarity reports.

@sofia-gomes-onfido sofia-gomes-onfido marked this pull request as ready for review March 22, 2024 14:23
package.json Show resolved Hide resolved
workflow_version_id: expect.anything(),
dashboard_url: expect.anything(),
status: expect.anything(),
output: expect.anything(),
Copy link
Contributor

Choose a reason for hiding this comment

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

I think it would be worth it validating output field to be sure it's accessible even if not defined in detail.

Copy link
Member

Choose a reason for hiding this comment

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

I ran these tests locally, and they're returning null in the output. Is that expected?

Copy link
Contributor

Choose a reason for hiding this comment

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

We haven't validated enough this output field yet, but the goal of improving these tests over was also to be sure that what is returned in output field, even if can't be mapped to a precise schema, it can be accessible.

Therefore probably workflow run should be improved to have some data in this field so that we can see such data can be accessed using client library.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

In Studio clients can define output to be whatever they want (a string, an object, etc). In my latest changes, I've added validations for output containing:

  • the outcome of a profile data capture task
  • the result of a document report and a facial similarity report

Copy link
Contributor

@dvacca-onfido dvacca-onfido left a comment

Choose a reason for hiding this comment

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

LGTM 🙇

@@ -43,10 +43,11 @@
"devDependencies": {
"@faker-js/faker": "^8.4.1",
"@types/jest": "^26.0.15",
"@types/node": "^12.11.5",
"dotenv": "^16.4.5",
Copy link
Contributor

Choose a reason for hiding this comment

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

Fine adding that this way for now. I've created PR#69 to not forget about this change.

@sofia-gomes-onfido sofia-gomes-onfido changed the title test: add tests focusing on workflow run outputs test: add tests focusing on workflow run outputs, document and facial similarity reports May 2, 2024
@sofia-gomes-onfido sofia-gomes-onfido merged commit e56f863 into master May 2, 2024
6 checks passed
@sofia-gomes-onfido sofia-gomes-onfido deleted the test/add-more-tests branch May 2, 2024 14:20
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