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

tests for src/lib/resolvers/Subscription/messageSentToGroupChat.ts #1113

Merged
merged 2 commits into from
Mar 5, 2023
Merged

tests for src/lib/resolvers/Subscription/messageSentToGroupChat.ts #1113

merged 2 commits into from
Mar 5, 2023

Conversation

KrutikaBhatt
Copy link
Contributor

What kind of change does this PR introduce?

Issue Number: #889

Fixes #889

Description:
Written tests for messageSentToGroupChat subscription by creating a mock test GroupChat Message.

Did you add tests for your changes? : Yes

Snapshots/Videos:
The coverage obtained is 100%

image
Other information
The subscription uses withFilter which has a filter function parameter that returns true if the user in the GroupChat is currentUser. The code block is the same just converted into a separate function for testing and used in the subscription

Have you read the contributing guide? Yes

@codecov
Copy link

codecov bot commented Mar 4, 2023

Codecov Report

Merging #1113 (064571c) into develop (83f22af) will increase coverage by 0.42%.
The diff coverage is 100.00%.

@@             Coverage Diff             @@
##           develop    #1113      +/-   ##
===========================================
+ Coverage    94.70%   95.12%   +0.42%     
===========================================
  Files          165      167       +2     
  Lines         9889     9983      +94     
  Branches       802      812      +10     
===========================================
+ Hits          9365     9496     +131     
+ Misses         523      486      -37     
  Partials         1        1              
Impacted Files Coverage Δ
...c/resolvers/Subscription/messageSentToGroupChat.ts 100.00% <100.00%> (+100.00%) ⬆️
src/resolvers/Mutation/createPost.ts 100.00% <0.00%> (ø)
src/resolvers/Mutation/adminRemovePost.ts
src/resolvers/Organization/image.ts 100.00% <0.00%> (ø)
src/resolvers/Organization/pinnedPosts.ts 100.00% <0.00%> (ø)
src/resolvers/Mutation/togglePostPin.ts 100.00% <0.00%> (ø)
src/resolvers/Mutation/removePost.ts 100.00% <0.00%> (+8.21%) ⬆️

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@Kevoniat
Copy link

Kevoniat commented Mar 5, 2023

looks good to me

@palisadoes palisadoes merged commit 5e6df04 into PalisadoesFoundation:develop Mar 5, 2023
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.

Test: src/lib/resolvers/Subscription/messageSentToGroupChat.ts
3 participants