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

Refactor remaining tests that instantiate QueryManager directly and remove mockQueryManager helper #12327

Merged
merged 97 commits into from
Jan 31, 2025
Merged
Changes from 1 commit
Commits
Show all changes
97 commits
Select commit Hold shift + click to select a range
16bfbd6
Add toEmitFetchResult matcher
jerelmiller Jan 31, 2025
9e18a16
Replace instantiation of QueryManager with instantiation of ApolloClient
jerelmiller Jan 31, 2025
a235468
Use toEmitFetchResult where appropriate
jerelmiller Jan 31, 2025
d43ba3b
Replace instantiation of QueryManager with instantiation of ApolloClient
jerelmiller Jan 31, 2025
63c890a
Replace instantiation of QueryManager with instantiation of ApolloClient
jerelmiller Jan 31, 2025
67789ca
Replace instantiation of QueryManager with instantiation of ApolloClient
jerelmiller Jan 31, 2025
d9f2ac8
Replace instantiation of QueryManager with instantiation of ApolloClient
jerelmiller Jan 31, 2025
49a07cd
Replace instantiation of QueryManager with instantiation of ApolloClient
jerelmiller Jan 31, 2025
e38549a
Replace instantiation of QueryManager with instantiation of ApolloClient
jerelmiller Jan 31, 2025
4dc9949
Replace instantiation of QueryManager with instantiation of ApolloClient
jerelmiller Jan 31, 2025
7bd78e3
Remove unused imports
jerelmiller Jan 31, 2025
8d054c4
Use ObservableStream to test error for subscriptions
jerelmiller Jan 31, 2025
c890972
Use ObservableStream for subscriptions test
jerelmiller Jan 31, 2025
d3e11dc
Inline result to simulateResult
jerelmiller Jan 31, 2025
3b626e3
Use ObservableStream for subscription test
jerelmiller Jan 31, 2025
590953b
Use ObservableStream to test subscription
jerelmiller Jan 31, 2025
647f290
USe ObservableStream to test subscription
jerelmiller Jan 31, 2025
9531ae1
Use ObsservableStream to test subscription
jerelmiller Jan 31, 2025
1fb04e7
Check for emitted value
jerelmiller Jan 31, 2025
fcb13cd
Use ObservableStream to test subscription
jerelmiller Jan 31, 2025
78d76c5
Replace instantiation of QueryManager with instantiation of ApolloClient
jerelmiller Jan 31, 2025
a0bd1e0
Use toEmitApolloQueryResult
jerelmiller Jan 31, 2025
3232105
Replace instantiation of QueryManager with instantiation of ApolloClient
jerelmiller Jan 31, 2025
b0fe67b
Replace instantiation of QueryManager with instantiation of ApolloClient
jerelmiller Jan 31, 2025
94f5d31
Replace instantiation of QueryManager with instantiation of ApolloClient
jerelmiller Jan 31, 2025
9243671
Replace instantiation of QueryManager with instantiation of ApolloClient
jerelmiller Jan 31, 2025
363f4a3
Replace instantiation of QueryManager with instantiation of ApolloClient
jerelmiller Jan 31, 2025
8656ccd
Replace instantiation of QueryManager with instantiation of ApolloClient
jerelmiller Jan 31, 2025
0146f6b
Replace instantiation of QueryManager with instantiation of ApolloClient
jerelmiller Jan 31, 2025
dfef74e
Replace instantiation of QueryManager with instantiation of ApolloClient
jerelmiller Jan 31, 2025
d379a73
Replace instantiation of QueryManager with instantiation of ApolloClient
jerelmiller Jan 31, 2025
add7bec
Fix test to match test description
jerelmiller Jan 31, 2025
4d23938
Replace instantiation of QueryManager with instantiation of ApolloClient
jerelmiller Jan 31, 2025
c31b18e
Replace instantiation of QueryManager with instantiation of ApolloClient
jerelmiller Jan 31, 2025
68cf0dc
Replace instantiation of QueryManager with instantiation of ApolloClient
jerelmiller Jan 31, 2025
eff2515
Replace instantiation of QueryManager with instantiation of ApolloClient
jerelmiller Jan 31, 2025
5f1a891
Add todo comment
jerelmiller Jan 31, 2025
e4c9121
Replace instantiation of QueryManager with instantiation of ApolloClient
jerelmiller Jan 31, 2025
9264d97
Remove duplicate check
jerelmiller Jan 31, 2025
b250f06
Replace instantiation of QueryManager with instantiation of ApolloClient
jerelmiller Jan 31, 2025
876b002
Replace instantiation of QueryManager with instantiation of ApolloClient
jerelmiller Jan 31, 2025
7362158
Replace instantiation of QueryManager with instantiation of ApolloClient
jerelmiller Jan 31, 2025
dc45cdd
Replace instantiation of QueryManager with instantiation of ApolloClient
jerelmiller Jan 31, 2025
f783c84
Replace instantiation of QueryManager with instantiation of ApolloClient
jerelmiller Jan 31, 2025
2023245
Replace instantiation of QueryManager with instantiation of ApolloClient
jerelmiller Jan 31, 2025
f72ea2c
Replace instantiation of QueryManager with instantiation of ApolloClient
jerelmiller Jan 31, 2025
1f5619d
Replace instantiation of QueryManager with instantiation of ApolloClient
jerelmiller Jan 31, 2025
730f3de
Replace instantiation of QueryManager with instantiation of ApolloClient
jerelmiller Jan 31, 2025
f84ef7d
Replace instantiation of QueryManager with instantiation of ApolloClient
jerelmiller Jan 31, 2025
d24dfbc
Replace instantiation of QueryManager with instantiation of ApolloClient
jerelmiller Jan 31, 2025
60db597
Replace instantiation of QueryManager with instantiation of ApolloClient
jerelmiller Jan 31, 2025
da2cd63
Use custom matchers to test for full query result
jerelmiller Jan 31, 2025
2efa813
Replace instantiation of QueryManager with instantiation of ApolloClient
jerelmiller Jan 31, 2025
27f018c
Replace instantiation of QueryManager with instantiation of ApolloClient
jerelmiller Jan 31, 2025
f78e186
Remove outdated comment
jerelmiller Jan 31, 2025
01be76d
Use custom matchers
jerelmiller Jan 31, 2025
5a3ecf8
Replace instantiation of QueryManager with instantiation of ApolloClient
jerelmiller Jan 31, 2025
eec859a
Inline link
jerelmiller Jan 31, 2025
0faca17
Use custom matchers
jerelmiller Jan 31, 2025
e9e0201
Use custom matchers
jerelmiller Jan 31, 2025
9e39df5
Add todo comments
jerelmiller Jan 31, 2025
e9f5109
Use custom matchers
jerelmiller Jan 31, 2025
4c04d6f
Replace instantiation of QueryManager with instantiation of ApolloClient
jerelmiller Jan 31, 2025
ee4d9b6
Use custom matchers
jerelmiller Jan 31, 2025
561f619
Replace instantiation of QueryManager with instantiation of ApolloClient
jerelmiller Jan 31, 2025
1851614
Use custom matchers
jerelmiller Jan 31, 2025
ce65dad
Replace instantiation of QueryManager with instantiation of ApolloClient
jerelmiller Jan 31, 2025
dcc3a87
Use custom matchers
jerelmiller Jan 31, 2025
510622f
Replace instantiation of QueryManager with instantiation of ApolloClient
jerelmiller Jan 31, 2025
6fd20f6
Replace instantiation of QueryManager with instantiation of ApolloClient
jerelmiller Jan 31, 2025
1c43ca3
Replace instantiation of QueryManager with instantiation of ApolloClient
jerelmiller Jan 31, 2025
dbdd72c
Replace instantiation of QueryManager with instantiation of ApolloClient
jerelmiller Jan 31, 2025
d3be98a
Replace instantiation of QueryManager with instantiation of ApolloClient
jerelmiller Jan 31, 2025
509992f
Replace instantiation of QueryManager with instantiation of ApolloClient
jerelmiller Jan 31, 2025
13dd441
Replace instantiation of QueryManager with instantiation of ApolloClient
jerelmiller Jan 31, 2025
e323133
Use custom matchers
jerelmiller Jan 31, 2025
27fe12a
Add clarifying comment
jerelmiller Jan 31, 2025
18b90d1
Replace instantiation of QueryManager with instantiation of ApolloClient
jerelmiller Jan 31, 2025
6d3b07e
Replace instantiation of QueryManager with instantiation of ApolloClient
jerelmiller Jan 31, 2025
98f5273
Use MockLink directly
jerelmiller Jan 31, 2025
4381582
Replace instantiation of QueryManager with instantiation of ApolloClient
jerelmiller Jan 31, 2025
74eef4d
Replace instantiation of QueryManager with instantiation of ApolloClient
jerelmiller Jan 31, 2025
be9c166
Replace instantiation of QueryManager with instantiation of ApolloClient
jerelmiller Jan 31, 2025
454887d
Use custom matchers
jerelmiller Jan 31, 2025
6432625
Replace instantiation of QueryManager with instantiation of ApolloClient
jerelmiller Jan 31, 2025
dd892bf
Replace instantiation of QueryManager with instantiation of ApolloClient
jerelmiller Jan 31, 2025
c49a472
Use custom matchers
jerelmiller Jan 31, 2025
1700cf7
Replace instantiation of QueryManager with instantiation of ApolloClient
jerelmiller Jan 31, 2025
62a7994
Replace instantiation of QueryManager with instantiation of ApolloClient
jerelmiller Jan 31, 2025
7acc2d2
Remove unused import
jerelmiller Jan 31, 2025
75a80bd
Add todo comment
jerelmiller Jan 31, 2025
17d7c98
Remove unused mockWatchQuery
jerelmiller Jan 31, 2025
ea37430
Replace instantiation of QueryManager with instantiation of ApolloClient
jerelmiller Jan 31, 2025
5b05edf
Use custom matchers in local state tests
jerelmiller Jan 31, 2025
f74292f
Remove outdated comment
jerelmiller Jan 31, 2025
955af26
Remove mockQueryManager
jerelmiller Jan 31, 2025
7d8883d
Fix typo
jerelmiller Jan 31, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Use toEmitFetchResult where appropriate
  • Loading branch information
jerelmiller committed Jan 31, 2025
commit a235468dbead63690c36312dc28501b953950b4a
12 changes: 6 additions & 6 deletions src/__tests__/graphqlSubscriptions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ describe("GraphQL Subscriptions", () => {
const stream = new ObservableStream(client.subscribe(defaultOptions));
link.simulateResult(results[0]);

await expect(stream).toEmitValue(results[0].result);
await expect(stream).toEmitFetchResult(results[0].result);

stream.unsubscribe();
});
Expand All @@ -75,7 +75,7 @@ describe("GraphQL Subscriptions", () => {

link.simulateResult(results[0]);

await expect(stream).toEmitValue(results[0].result);
await expect(stream).toEmitFetchResult(results[0].result);

stream.unsubscribe();
});
Expand Down Expand Up @@ -114,10 +114,10 @@ describe("GraphQL Subscriptions", () => {
link.simulateResult(results[i]);
}

await expect(stream).toEmitValue(results[0].result);
await expect(stream).toEmitValue(results[1].result);
await expect(stream).toEmitValue(results[2].result);
await expect(stream).toEmitValue(results[3].result);
await expect(stream).toEmitFetchResult(results[0].result);
await expect(stream).toEmitFetchResult(results[1].result);
await expect(stream).toEmitFetchResult(results[2].result);
await expect(stream).toEmitFetchResult(results[3].result);
await expect(stream).not.toEmitAnything();
});

Expand Down