-
Notifications
You must be signed in to change notification settings - Fork 227
fix: add blog post comment schema and tests #970
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
Conversation
Codecov Report
@@ Coverage Diff @@
## main #970 +/- ##
==========================================
+ Coverage 55.10% 55.13% +0.02%
==========================================
Files 630 630
Lines 18195 18195
==========================================
+ Hits 10027 10031 +4
+ Misses 8168 8164 -4
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
0ddd802 to
a77fc97
Compare
...re/AWSDataStoreCategoryPluginIntegrationTests/TestSupport/HubEventsIntegrationTestBase.swift
Show resolved
Hide resolved
.../AWSAPICategoryPluginFunctionalTests/GraphQLModelBased/GraphQLConnectionScenario6Tests.swift
Outdated
Show resolved
Hide resolved
| override func setUp() { | ||
| do { | ||
| Amplify.Logging.logLevel = .verbose | ||
| try Amplify.add(plugin: AWSAPIPlugin()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a difference between passing in the models to AWSAPIPlugin vs using ModelRegistry.register(modelType: Blog6.self)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i don't think so, just easier to set up in the test code without having to create another class that calls the register methods
|
|
||
| extension GraphQLConnectionScenario3Tests { | ||
|
|
||
| func createPost(id: String = UUID().uuidString, title: String) -> Post3? { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Might be better to decouple the creation of the Post3 with calling mutate. For example, something like:
func createPost(id: title) -> Post3
func mutatePost(post: Post) -> Post3
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that sounds good, mutatePost will make more sense since it's passing in some post that was retrieved instead of creating a dummy post (this was also bad because the dummy post created for the update will overwrite some other fields that take default values in the constructor)
...ategoryPluginFunctionalTests/GraphQLModelBased/GraphQLConnectionScenario3Tests+Helpers.swift
Outdated
Show resolved
Hide resolved
.../AWSAPICategoryPluginFunctionalTests/GraphQLModelBased/GraphQLConnectionScenario3Tests.swift
Outdated
Show resolved
Hide resolved
.../AWSAPICategoryPluginFunctionalTests/GraphQLModelBased/GraphQLConnectionScenario3Tests.swift
Outdated
Show resolved
Hide resolved
.../AWSAPICategoryPluginFunctionalTests/GraphQLModelBased/GraphQLConnectionScenario3Tests.swift
Outdated
Show resolved
Hide resolved
.../AWSAPICategoryPluginFunctionalTests/GraphQLModelBased/GraphQLConnectionScenario3Tests.swift
Outdated
Show resolved
Hide resolved
| } | ||
| } | ||
| wait(for: [completeInvoked], timeout: TestCommonConstants.networkTimeout) | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we fail to wait for completeInvoked, i think the test will continue to execute here (right?)... is this what we want, or should we just fail?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if it fails to wait for the expectation, it should fail the test and shouldn't continue to execute. we want it to continue when the expectation is met to then query for the deleted post to check that it's not there
618coffee
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me, you can address John's comments
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Chatted offline, lawmicha@ will work on refactoring tests to improve readability of unit tests
Issue #, if available:
Description of changes:
amplify add apiBy submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.