Skip to content

Commit c408ef8

Browse files
committed
some conflicts found
1 parent ea2bf1c commit c408ef8

File tree

7 files changed

+1
-279
lines changed

7 files changed

+1
-279
lines changed

src/schema/__tests__/film.spec.ts

-41
Original file line numberDiff line numberDiff line change
@@ -30,37 +30,23 @@ describe('Film type', () => {
3030
it('Gets an object by SWAPI ID', async () => {
3131
const query = '{ film(filmID: 1) { title } }';
3232
const result = await swapi(query);
33-
<<<<<<< HEAD:src/schema/__tests__/film.spec.ts
3433
expect(result.data?.film.title).toBe('A New Hope');
35-
=======
36-
expect(result.data.film.title).toBe('A New Hope');
37-
>>>>>>> c1ad3d9f0abdc1c196b98e10587b844e4a6ec518:src/schema/__tests__/film.spec.js
3834
});
3935

4036
it('Gets a different object by SWAPI ID', async () => {
4137
const query = '{ film(filmID: 2) { title } }';
4238
const result = await swapi(query);
43-
<<<<<<< HEAD:src/schema/__tests__/film.spec.ts
4439
expect(result.data?.film.title).toBe('The Empire Strikes Back');
45-
=======
46-
expect(result.data.film.title).toBe('The Empire Strikes Back');
47-
>>>>>>> c1ad3d9f0abdc1c196b98e10587b844e4a6ec518:src/schema/__tests__/film.spec.js
4840
});
4941

5042
it('Gets an object by global ID', async () => {
5143
const query = '{ film(filmID: 1) { id, title } }';
5244
const result = await swapi(query);
5345
const nextQuery = `{ film(id: "${result.data?.film.id}") { id, title } }`;
5446
const nextResult = await swapi(nextQuery);
55-
<<<<<<< HEAD:src/schema/__tests__/film.spec.ts
5647
expect(result.data?.film.title).toBe('A New Hope');
5748
expect(nextResult.data?.film.title).toBe('A New Hope');
5849
expect(result.data?.film.id).toBe(nextResult.data?.film.id);
59-
=======
60-
expect(result.data.film.title).toBe('A New Hope');
61-
expect(nextResult.data.film.title).toBe('A New Hope');
62-
expect(result.data.film.id).toBe(nextResult.data.film.id);
63-
>>>>>>> c1ad3d9f0abdc1c196b98e10587b844e4a6ec518:src/schema/__tests__/film.spec.js
6450
});
6551

6652
it('Gets an object by global ID with node', async () => {
@@ -75,15 +61,9 @@ describe('Film type', () => {
7561
}
7662
}`;
7763
const nextResult = await swapi(nextQuery);
78-
<<<<<<< HEAD:src/schema/__tests__/film.spec.ts
7964
expect(result.data?.film.title).toBe('A New Hope');
8065
expect(nextResult.data?.node.title).toBe('A New Hope');
8166
expect(result.data?.film.id).toBe(nextResult.data?.node.id);
82-
=======
83-
expect(result.data.film.title).toBe('A New Hope');
84-
expect(nextResult.data.node.title).toBe('A New Hope');
85-
expect(result.data.film.id).toBe(nextResult.data.node.id);
86-
>>>>>>> c1ad3d9f0abdc1c196b98e10587b844e4a6ec518:src/schema/__tests__/film.spec.js
8767
});
8868

8969
it('Gets all properties', async () => {
@@ -109,53 +89,32 @@ describe('Film type', () => {
10989
characterConnection: { edges: [{ node: { name: 'Luke Skywalker' } }] },
11090
planetConnection: { edges: [{ node: { name: 'Tatooine' } }] },
11191
};
112-
<<<<<<< HEAD:src/schema/__tests__/film.spec.ts
11392
expect(result.data?.film).toMatchObject(expected);
114-
=======
115-
expect(result.data.film).toMatchObject(expected);
116-
>>>>>>> c1ad3d9f0abdc1c196b98e10587b844e4a6ec518:src/schema/__tests__/film.spec.js
11793
});
11894

11995
it('All objects query', async () => {
12096
const query = getDocument(
12197
'{ allFilms { edges { cursor, node { ...AllFilmProperties } } } }',
12298
);
12399
const result = await swapi(query);
124-
<<<<<<< HEAD:src/schema/__tests__/film.spec.ts
125100
expect(result.data?.allFilms.edges.length).toBe(6);
126-
=======
127-
expect(result.data.allFilms.edges.length).toBe(6);
128-
>>>>>>> c1ad3d9f0abdc1c196b98e10587b844e4a6ec518:src/schema/__tests__/film.spec.js
129101
});
130102

131103
it('Pagination query', async () => {
132104
const query = `{
133105
allFilms(first: 2) { edges { cursor, node { title } } }
134106
}`;
135107
const result = await swapi(query);
136-
<<<<<<< HEAD:src/schema/__tests__/film.spec.ts
137108
expect(
138109
result.data?.allFilms.edges.map((e: any) => e.node.title),
139110
).toMatchObject(['A New Hope', 'The Empire Strikes Back']);
140111
const nextCursor = result.data?.allFilms.edges[1].cursor;
141-
=======
142-
expect(result.data.allFilms.edges.map(e => e.node.title)).toMatchObject([
143-
'A New Hope',
144-
'The Empire Strikes Back',
145-
]);
146-
const nextCursor = result.data.allFilms.edges[1].cursor;
147-
>>>>>>> c1ad3d9f0abdc1c196b98e10587b844e4a6ec518:src/schema/__tests__/film.spec.js
148-
149112
const nextQuery = `{ allFilms(first: 2, after:"${nextCursor}") {
150113
edges { cursor, node { title } } }
151114
}`;
152115
const nextResult = await swapi(nextQuery);
153116
expect(
154-
<<<<<<< HEAD:src/schema/__tests__/film.spec.ts
155117
nextResult.data?.allFilms.edges.map((e: any) => e.node.title),
156-
=======
157-
nextResult.data.allFilms.edges.map(e => e.node.title),
158-
>>>>>>> c1ad3d9f0abdc1c196b98e10587b844e4a6ec518:src/schema/__tests__/film.spec.js
159118
).toMatchObject(['Return of the Jedi', 'The Phantom Menace']);
160119
});
161120
});

src/schema/__tests__/person.spec.ts

-51
Original file line numberDiff line numberDiff line change
@@ -32,37 +32,23 @@ describe('Person type', () => {
3232
it('Gets an object by SWAPI ID', async () => {
3333
const query = '{ person(personID: 1) { name } }';
3434
const result = await swapi(query);
35-
<<<<<<< HEAD:src/schema/__tests__/person.spec.ts
36-
expect(result.data?.person.name).toBe('Luke Skywalker');
37-
=======
3835
expect(result.data.person.name).toBe('Luke Skywalker');
39-
>>>>>>> c1ad3d9f0abdc1c196b98e10587b844e4a6ec518:src/schema/__tests__/person.spec.js
4036
});
4137

4238
it('Gets a different object by SWAPI ID', async () => {
4339
const query = '{ person(personID: 2) { name } }';
4440
const result = await swapi(query);
45-
<<<<<<< HEAD:src/schema/__tests__/person.spec.ts
4641
expect(result.data?.person.name).toBe('C-3PO');
47-
=======
48-
expect(result.data.person.name).toBe('C-3PO');
49-
>>>>>>> c1ad3d9f0abdc1c196b98e10587b844e4a6ec518:src/schema/__tests__/person.spec.js
5042
});
5143

5244
it('Gets an object by global ID', async () => {
5345
const query = '{ person(personID: 1) { id, name } }';
5446
const result = await swapi(query);
5547
const nextQuery = `{ person(id: "${result.data?.person.id}") { id, name } }`;
5648
const nextResult = await swapi(nextQuery);
57-
<<<<<<< HEAD:src/schema/__tests__/person.spec.ts
5849
expect(result.data?.person.name).toBe('Luke Skywalker');
5950
expect(nextResult.data?.person.name).toBe('Luke Skywalker');
6051
expect(result.data?.person.id).toBe(nextResult.data?.person.id);
61-
=======
62-
expect(result.data.person.name).toBe('Luke Skywalker');
63-
expect(nextResult.data.person.name).toBe('Luke Skywalker');
64-
expect(result.data.person.id).toBe(nextResult.data.person.id);
65-
>>>>>>> c1ad3d9f0abdc1c196b98e10587b844e4a6ec518:src/schema/__tests__/person.spec.js
6652
});
6753

6854
it('Gets an object by global ID with node', async () => {
@@ -77,15 +63,9 @@ describe('Person type', () => {
7763
}
7864
}`;
7965
const nextResult = await swapi(nextQuery);
80-
<<<<<<< HEAD:src/schema/__tests__/person.spec.ts
8166
expect(result.data?.person.name).toBe('Luke Skywalker');
8267
expect(nextResult.data?.node.name).toBe('Luke Skywalker');
8368
expect(result.data?.person.id).toBe(nextResult.data?.node.id);
84-
=======
85-
expect(result.data.person.name).toBe('Luke Skywalker');
86-
expect(nextResult.data.node.name).toBe('Luke Skywalker');
87-
expect(result.data.person.id).toBe(nextResult.data.node.id);
88-
>>>>>>> c1ad3d9f0abdc1c196b98e10587b844e4a6ec518:src/schema/__tests__/person.spec.js
8969
});
9070

9171
it('Gets all properties', async () => {
@@ -112,79 +92,48 @@ describe('Person type', () => {
11292
starshipConnection: { edges: [{ node: { name: 'X-wing' } }] },
11393
vehicleConnection: { edges: [{ node: { name: 'Snowspeeder' } }] },
11494
};
115-
<<<<<<< HEAD:src/schema/__tests__/person.spec.ts
11695
expect(result.data?.person).toMatchObject(expected);
117-
=======
118-
expect(result.data.person).toMatchObject(expected);
119-
>>>>>>> c1ad3d9f0abdc1c196b98e10587b844e4a6ec518:src/schema/__tests__/person.spec.js
12096
});
12197

12298
it('All objects query', async () => {
12399
const query = getDocument(
124100
'{ allPeople { edges { cursor, node { ...AllPersonProperties } } } }',
125101
);
126102
const result = await swapi(query);
127-
<<<<<<< HEAD:src/schema/__tests__/person.spec.ts
128103
expect(result.data?.allPeople.edges.length).toBe(82);
129-
=======
130-
expect(result.data.allPeople.edges.length).toBe(82);
131-
>>>>>>> c1ad3d9f0abdc1c196b98e10587b844e4a6ec518:src/schema/__tests__/person.spec.js
132104
});
133105

134106
it('Pagination query', async () => {
135107
const query = `{
136108
allPeople(first: 2) { edges { cursor, node { name } } }
137109
}`;
138110
const result = await swapi(query);
139-
<<<<<<< HEAD:src/schema/__tests__/person.spec.ts
140111
expect(
141112
result.data?.allPeople.edges.map((e: any) => e.node.name),
142113
).toMatchObject(['Luke Skywalker', 'C-3PO']);
143114
const nextCursor = result.data?.allPeople.edges[1].cursor;
144-
=======
145-
expect(result.data.allPeople.edges.map(e => e.node.name)).toMatchObject([
146-
'Luke Skywalker',
147-
'C-3PO',
148-
]);
149-
const nextCursor = result.data.allPeople.edges[1].cursor;
150-
>>>>>>> c1ad3d9f0abdc1c196b98e10587b844e4a6ec518:src/schema/__tests__/person.spec.js
151-
152115
const nextQuery = `{ allPeople(first: 2, after:"${nextCursor}") {
153116
edges { cursor, node { name } } }
154117
}`;
155118
const nextResult = await swapi(nextQuery);
156119
expect(
157-
<<<<<<< HEAD:src/schema/__tests__/person.spec.ts
158120
nextResult.data?.allPeople.edges.map((e: any) => e.node.name),
159-
=======
160-
nextResult.data.allPeople.edges.map(e => e.node.name),
161-
>>>>>>> c1ad3d9f0abdc1c196b98e10587b844e4a6ec518:src/schema/__tests__/person.spec.js
162121
).toMatchObject(['R2-D2', 'Darth Vader']);
163122
});
164123

165124
describe('Edge cases', () => {
166125
it('Returns null if no species is set', async () => {
167126
const query = '{ person(personID: 42) { name, species { name } } }';
168127
const result = await swapi(query);
169-
<<<<<<< HEAD:src/schema/__tests__/person.spec.ts
170128
expect(result.data?.person.name).toBe('Quarsh Panaka');
171129
expect(result.data?.person.species).toBe(null);
172-
=======
173-
expect(result.data.person.name).toBe('Quarsh Panaka');
174-
expect(result.data.person.species).toBe(null);
175-
>>>>>>> c1ad3d9f0abdc1c196b98e10587b844e4a6ec518:src/schema/__tests__/person.spec.js
176130
});
177131

178132
it('Returns correctly if a species is set', async () => {
179133
const query = '{ person(personID: 67) { name, species { name } } }';
180134
const result = await swapi(query);
181-
<<<<<<< HEAD:src/schema/__tests__/person.spec.ts
182135
expect(result.data?.person.name).toBe('Dooku');
183136
expect(result.data?.person.species.name).toBe('Human');
184-
=======
185-
expect(result.data.person.name).toBe('Dooku');
186-
expect(result.data.person.species.name).toBe('Human');
187-
>>>>>>> c1ad3d9f0abdc1c196b98e10587b844e4a6ec518:src/schema/__tests__/person.spec.js
188137
});
189138
});
190139
});

src/schema/__tests__/planet.spec.ts

-41
Original file line numberDiff line numberDiff line change
@@ -30,37 +30,23 @@ describe('Planet type', () => {
3030
it('Gets an object by SWAPI ID', async () => {
3131
const query = '{ planet(planetID: 1) { name } }';
3232
const result = await swapi(query);
33-
<<<<<<< HEAD:src/schema/__tests__/planet.spec.ts
3433
expect(result.data?.planet.name).toBe('Tatooine');
35-
=======
36-
expect(result.data.planet.name).toBe('Tatooine');
37-
>>>>>>> c1ad3d9f0abdc1c196b98e10587b844e4a6ec518:src/schema/__tests__/planet.spec.js
3834
});
3935

4036
it('Gets a different object by SWAPI ID', async () => {
4137
const query = '{ planet(planetID: 2) { name } }';
4238
const result = await swapi(query);
43-
<<<<<<< HEAD:src/schema/__tests__/planet.spec.ts
4439
expect(result.data?.planet.name).toBe('Alderaan');
45-
=======
46-
expect(result.data.planet.name).toBe('Alderaan');
47-
>>>>>>> c1ad3d9f0abdc1c196b98e10587b844e4a6ec518:src/schema/__tests__/planet.spec.js
4840
});
4941

5042
it('Gets an object by global ID', async () => {
5143
const query = '{ planet(planetID: 1) { id, name } }';
5244
const result = await swapi(query);
5345
const nextQuery = `{ planet(id: "${result.data?.planet.id}") { id, name } }`;
5446
const nextResult = await swapi(nextQuery);
55-
<<<<<<< HEAD:src/schema/__tests__/planet.spec.ts
5647
expect(result.data?.planet.name).toBe('Tatooine');
5748
expect(nextResult.data?.planet.name).toBe('Tatooine');
5849
expect(result.data?.planet.id).toBe(nextResult.data?.planet.id);
59-
=======
60-
expect(result.data.planet.name).toBe('Tatooine');
61-
expect(nextResult.data.planet.name).toBe('Tatooine');
62-
expect(result.data.planet.id).toBe(nextResult.data.planet.id);
63-
>>>>>>> c1ad3d9f0abdc1c196b98e10587b844e4a6ec518:src/schema/__tests__/planet.spec.js
6450
});
6551

6652
it('Gets an object by global ID with node', async () => {
@@ -75,15 +61,9 @@ describe('Planet type', () => {
7561
}
7662
}`;
7763
const nextResult = await swapi(nextQuery);
78-
<<<<<<< HEAD:src/schema/__tests__/planet.spec.ts
7964
expect(result.data?.planet.name).toBe('Tatooine');
8065
expect(nextResult.data?.node.name).toBe('Tatooine');
8166
expect(result.data?.planet.id).toBe(nextResult.data?.node.id);
82-
=======
83-
expect(result.data.planet.name).toBe('Tatooine');
84-
expect(nextResult.data.node.name).toBe('Tatooine');
85-
expect(result.data.planet.id).toBe(nextResult.data.node.id);
86-
>>>>>>> c1ad3d9f0abdc1c196b98e10587b844e4a6ec518:src/schema/__tests__/planet.spec.js
8767
});
8868

8969
it('Gets all properties', async () => {
@@ -108,11 +88,7 @@ describe('Planet type', () => {
10888
surfaceWater: 1,
10989
terrains: ['desert'],
11090
};
111-
<<<<<<< HEAD:src/schema/__tests__/planet.spec.ts
11291
expect(result.data?.planet).toMatchObject(expected);
113-
=======
114-
expect(result.data.planet).toMatchObject(expected);
115-
>>>>>>> c1ad3d9f0abdc1c196b98e10587b844e4a6ec518:src/schema/__tests__/planet.spec.js
11692
});
11793

11894
it('All objects query', async () => {
@@ -121,45 +97,28 @@ describe('Planet type', () => {
12197
);
12298
debugger;
12399
const result = await swapi(query);
124-
<<<<<<< HEAD:src/schema/__tests__/planet.spec.ts
125100
expect(result.data?.allPlanets.edges.length).toBe(60);
126-
=======
127-
expect(result.data.allPlanets.edges.length).toBe(60);
128-
>>>>>>> c1ad3d9f0abdc1c196b98e10587b844e4a6ec518:src/schema/__tests__/planet.spec.js
129101
});
130102

131103
it('Pagination query', async () => {
132104
const query = `{
133105
allPlanets(first: 2) { edges { cursor, node { name } } }
134106
}`;
135107
const result = await swapi(query);
136-
<<<<<<< HEAD:src/schema/__tests__/planet.spec.ts
137108
expect(
138109
result.data?.allPlanets.edges.map(
139110
(e: Record<string, any>) => e.node.name,
140111
),
141112
).toMatchObject(['Tatooine', 'Alderaan']);
142113
const nextCursor = result.data?.allPlanets.edges[1].cursor;
143-
=======
144-
expect(result.data.allPlanets.edges.map(e => e.node.name)).toMatchObject([
145-
'Tatooine',
146-
'Alderaan',
147-
]);
148-
const nextCursor = result.data.allPlanets.edges[1].cursor;
149-
>>>>>>> c1ad3d9f0abdc1c196b98e10587b844e4a6ec518:src/schema/__tests__/planet.spec.js
150-
151114
const nextQuery = `{ allPlanets(first: 2, after:"${nextCursor}") {
152115
edges { cursor, node { name } } }
153116
}`;
154117
const nextResult = await swapi(nextQuery);
155118
expect(
156-
<<<<<<< HEAD:src/schema/__tests__/planet.spec.ts
157119
nextResult.data?.allPlanets.edges.map(
158120
(e: Record<string, any>) => e.node.name,
159121
),
160-
=======
161-
nextResult.data.allPlanets.edges.map(e => e.node.name),
162-
>>>>>>> c1ad3d9f0abdc1c196b98e10587b844e4a6ec518:src/schema/__tests__/planet.spec.js
163122
).toMatchObject(['Yavin IV', 'Hoth']);
164123
});
165124
});

src/schema/__tests__/schema.spec.ts

-14
Original file line numberDiff line numberDiff line change
@@ -6,39 +6,25 @@
66
* LICENSE-examples file in the root directory of this source tree.
77
*/
88

9-
<<<<<<< HEAD:src/schema/__tests__/schema.spec.ts
109
import swapiSchema from '..';
11-
=======
12-
import swapiSchema from '../';
13-
>>>>>>> c1ad3d9f0abdc1c196b98e10587b844e4a6ec518:src/schema/__tests__/schema.spec.js
1410
import { graphql } from 'graphql';
1511

1612
describe('Schema', () => {
1713
it('Gets an error when ID is omitted', async () => {
1814
const query = '{ species { name } }';
1915
const result = await graphql(swapiSchema, query);
20-
<<<<<<< HEAD:src/schema/__tests__/schema.spec.ts
2116
expect(result?.errors?.length).toBe(1);
2217
expect(result.errors && result.errors[0].message).toBe(
2318
'must provide id or speciesID',
2419
);
25-
=======
26-
expect(result.errors.length).toBe(1);
27-
expect(result.errors[0].message).toBe('must provide id or speciesID');
28-
>>>>>>> c1ad3d9f0abdc1c196b98e10587b844e4a6ec518:src/schema/__tests__/schema.spec.js
2920
expect(result.data).toMatchObject({ species: null });
3021
});
3122

3223
it('Gets an error when global ID is invalid', async () => {
3324
const query = '{ species(id: "notanid") { name } }';
3425
const result = await graphql(swapiSchema, query);
35-
<<<<<<< HEAD:src/schema/__tests__/schema.spec.ts
3626
expect(result.errors?.length).toBe(1);
3727
expect(result.errors && result.errors[0].message).toEqual(
38-
=======
39-
expect(result.errors.length).toBe(1);
40-
expect(result.errors[0].message).toEqual(
41-
>>>>>>> c1ad3d9f0abdc1c196b98e10587b844e4a6ec518:src/schema/__tests__/schema.spec.js
4228
expect.stringContaining('No entry in local cache for'),
4329
);
4430
expect(result.data).toMatchObject({ species: null });

0 commit comments

Comments
 (0)