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(repository-tests): adding acceptance tests for hasManyThrough relation #5765

Merged
merged 1 commit into from
Jun 29, 2020

Conversation

agnes512
Copy link
Contributor

@agnes512 agnes512 commented Jun 17, 2020

#4438 #2359

Checklist

👉 Read and sign the CLA (Contributor License Agreement) 👈

  • npm test passes on your machine
  • New tests added or existing tests modified to cover all changes
  • Code conforms with the style guide
  • API Documentation in code was updated
  • Documentation in /docs/site was updated
  • Affected artifact templates in packages/cli were updated
  • Affected example projects in examples/* were updated

👉 Check out how to submit a PR 👈

@agnes512 agnes512 added the Relations Model relations (has many, etc.) label Jun 17, 2020
@agnes512 agnes512 force-pushed the hmt-acpt-test branch 2 times, most recently from 7eb708d to 02380ed Compare June 28, 2020 15:15
@agnes512 agnes512 requested review from jannyHou and bajtos June 28, 2020 15:16
@agnes512 agnes512 marked this pull request as ready for review June 28, 2020 15:16
@agnes512 agnes512 requested a review from hacksparrow as a code owner June 28, 2020 15:16
@agnes512 agnes512 removed the request for review from hacksparrow June 28, 2020 15:17
Copy link
Contributor

@jannyHou jannyHou left a comment

Choose a reason for hiding this comment

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

👏 Glad to see HMT pass acceptance tests for connectors. LGTM!

I left a few comments for advanced test cases, if they are valid, feel free to address them in separate PRs.


await expect(
customerRepo.cartItems(existingCustomerId).patch({id: anotherId}),
).to.be.rejectedWith(/Property "id" cannot be changed!/);
Copy link
Contributor

Choose a reason for hiding this comment

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

👍

expect(links).have.length(2);
expect(cartItems).have.length(2);

await customerRepo.cartItems(existingCustomerId).delete();
Copy link
Contributor

Choose a reason for hiding this comment

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

nitpick: does delete takes in a filter? Maybe add another test for delete with filter

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Just realized that the delete method has a bug. It is able to delete targets based on the filter but it deletes all through instance that has the souceKey. Will open up an issue to fix it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The issue is being tracked in #5852

@agnes512 agnes512 merged commit c04ea94 into master Jun 29, 2020
@agnes512 agnes512 deleted the hmt-acpt-test branch June 29, 2020 18:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Relations Model relations (has many, etc.)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants