forked from clintonwoo/hackernews-react-graphql
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgraphql-resolvers.spec.ts
56 lines (47 loc) · 1.43 KB
/
graphql-resolvers.spec.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
import { sampleData } from '../src/data/sample-data';
import { resolvers } from './graphql-resolvers';
describe('graphql-resolvers', () => {
describe('Queries', () => {
it('returns expected data for query on Feed', () => {
expect(true);
});
it('returns expected data for query on Comment', () => {
const result = (resolvers.Query as any).comment(
undefined,
{ id: sampleData.topStoriesCache[0].comments[0].id },
{
CommentService: {
getComment: (id) =>
sampleData.topStoriesCache[0].comments.find((comment) => comment.id === id),
},
}
);
expect(result).toBeDefined();
});
it('returns expected data for query on Me', () => {
expect(true).toBeTruthy();
});
it('returns expected data for News Item query', () => {
expect(true).toBeTruthy();
});
it('returns expected data for User query', () => {
expect(true).toBeTruthy();
});
});
describe('Mutations', () => {
it('returns data for upvoteNewsItem mutation', () => {
expect(true).toBeTruthy();
});
it('returns data for submitNewsItem mutation', () => {
expect(true).toBeTruthy();
});
});
describe('Property Resolvers', () => {
it('newsItem author is a user', () => {
expect(true).toBeTruthy();
});
it('newsItem comments are comments', () => {
expect(true).toBeTruthy();
});
});
});