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

New test data models documentation #687

Merged
merged 8 commits into from
Oct 8, 2024
Merged

New test data models documentation #687

merged 8 commits into from
Oct 8, 2024

Conversation

CarlosCortizasCT
Copy link
Contributor

This PRs add new documentation to the repository where we explain how new test data models look like and how to build them.

Copy link

changeset-bot bot commented Oct 3, 2024

⚠️ No Changeset found

Latest commit: 783806a

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@CarlosCortizasCT CarlosCortizasCT self-assigned this Oct 3, 2024
docs/contributing/test-data-models-overview.md Outdated Show resolved Hide resolved
docs/contributing/test-data-models-overview.md Outdated Show resolved Hide resolved
docs/contributing/test-data-models-overview.md Outdated Show resolved Hide resolved
docs/contributing/test-data-models-overview.md Outdated Show resolved Hide resolved
docs/contributing/test-data-models-overview.md Outdated Show resolved Hide resolved
docs/contributing/test-data-models-overview.md Outdated Show resolved Hide resolved
docs/guidelines/creating-new-model.md Outdated Show resolved Hide resolved
docs/guidelines/creating-new-model.md Outdated Show resolved Hide resolved
docs/guidelines/creating-new-model.md Outdated Show resolved Hide resolved
docs/guidelines/creating-new-model.md Outdated Show resolved Hide resolved

## Context

First of all, remember that a test data model is a set of objects that allows to create objects that mimic commercetools APIs responses which help during testing implementation.
Copy link
Contributor

@tylermorrisford tylermorrisford Oct 3, 2024

Choose a reason for hiding this comment

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

Suggested change
First of all, remember that a test data model is a set of objects that allows to create objects that mimic commercetools APIs responses which help during testing implementation.
First of all, remember that a test data model is a set of objects that allow consumers to create objects that mimic commercetools APIs responses which help during testing implementation.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Update here: 1f27b84

};
```

In this example, `name` and `description` are values that are calculated based on the `nameAllLocales` and `descriptionAllLocales`. The latter need to be built first using the `postBuild` function.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
In this example, `name` and `description` are values that are calculated based on the `nameAllLocales` and `descriptionAllLocales`. The latter need to be built first using the `postBuild` function.
In this example, `name` and `description` are values that are calculated based on the `nameAllLocales` and `descriptionAllLocales`. The latter need to be built first, then `name` and `description` are built using the `postBuild` function.

Copy link
Contributor

Choose a reason for hiding this comment

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

Hopefully I have the order correct here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated here: fdafc20

Copy link
Contributor

@tylermorrisford tylermorrisford left a comment

Choose a reason for hiding this comment

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

A few nits that honestly you can take or leave! I adore the CLI for generating new models. New contributors will have a much lower hurdle.

@CarlosCortizasCT CarlosCortizasCT requested a review from a team October 4, 2024 09:56
Copy link
Contributor

@Sarah4VT Sarah4VT left a comment

Choose a reason for hiding this comment

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

Only one paragraph that I suggested a few grammatical fixes for, but nothing blocking merging.

Comment on lines 155 to 156
This is an optional and we should only use if there are any dependencies among the data model fields.
In this case, `name` and `description` depend on the values from `nameAllLocales` and `descriptionAllLocales` but we don't know them in advance but only once the data model has been built. The `postBuild` callback allows to manipulate the built object before it's returned to the consumer.
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: Small grammatical cleanup.

Suggested change
This is an optional and we should only use if there are any dependencies among the data model fields.
In this case, `name` and `description` depend on the values from `nameAllLocales` and `descriptionAllLocales` but we don't know them in advance but only once the data model has been built. The `postBuild` callback allows to manipulate the built object before it's returned to the consumer.
This is optional and we should only use it if there are any dependencies among the data model fields.
In this case, `name` and `description` depend on the values from `nameAllLocales` and `descriptionAllLocales`. We won't know the values in advance, but will once the data model has been built. The `postBuild` callback allows us to manipulate the built object before it's returned to the consumer.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for the suggestion, Sarah 🙇

Applied here: 783806a

@CarlosCortizasCT CarlosCortizasCT merged commit a6a39db into main Oct 8, 2024
4 checks passed
@CarlosCortizasCT CarlosCortizasCT deleted the cm-fec-89 branch October 8, 2024 13:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fe-chapter-rotation Tasks coming from frontend chapter work
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants