Skip to content

Commit 82b9f78

Browse files
chore: fix broken gql test service (#1498)
1 parent 375c37f commit 82b9f78

File tree

3 files changed

+25
-4
lines changed

3 files changed

+25
-4
lines changed

tests/specs/graphql-metadata.e2e.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ describe('GraphQL metadata is appended to relevant ajax calls', () => {
2828
trigger: 'initialPageLoad',
2929
children: expect.arrayContaining([expect.objectContaining({
3030
type: 'ajax',
31-
domain: 'flyby-router-demo.herokuapp.com:443',
31+
domain: expect.stringMatching(/bam-test-1\.nr-local\.net/),
3232
children: expect.arrayContaining([
3333
{
3434
type: 'stringAttribute',
@@ -47,7 +47,7 @@ describe('GraphQL metadata is appended to relevant ajax calls', () => {
4747
)
4848
expect(gqlHarvest.request.body).toEqual(expect.arrayContaining([expect.objectContaining({
4949
type: 'ajax',
50-
domain: 'flyby-router-demo.herokuapp.com:443',
50+
domain: expect.stringMatching(/bam-test-1\.nr-local\.net/),
5151
children: expect.arrayContaining([
5252
{
5353
type: 'stringAttribute',

tools/test-builds/library-wrapper/src/apollo-client.js

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,18 @@ const opts = {
1010
new BrowserAgent(opts)
1111

1212
const client = new ApolloClient({
13-
uri: 'https://flyby-router-demo.herokuapp.com/',
14-
cache: new InMemoryCache()
13+
uri: '/gql',
14+
cache: new InMemoryCache(),
15+
defaultOptions: {
16+
watchQuery: {
17+
fetchPolicy: 'no-cache',
18+
errorPolicy: 'ignore'
19+
},
20+
query: {
21+
fetchPolicy: 'no-cache',
22+
errorPolicy: 'all'
23+
}
24+
}
1525
})
1626
var locations = ['id', 'name', 'description']
1727
window.sendGQL = function (operationName = 'standalone') {

tools/testing-server/routes/mock-apis.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,17 @@ module.exports = fp(async function (fastify, testServer) {
188188
}, (request, reply) => {
189189
reply.send({ text: 'hi!' })
190190
})
191+
fastify.post('/gql', {
192+
compress: false
193+
}, (request, reply) => {
194+
reply.send({
195+
data: {
196+
text: 'hi',
197+
locations: 'test locations',
198+
description: 'test description'
199+
}
200+
})
201+
})
191202
fastify.get('/js', {
192203
compress: false
193204
}, (request, reply) => {

0 commit comments

Comments
 (0)