From 3c03e3c741b25a83632ddd3d3812dd0e3ec5cf19 Mon Sep 17 00:00:00 2001 From: Ramon Wenger Date: Mon, 18 Oct 2021 17:46:45 +0200 Subject: [PATCH] Add new test, update naming --- .../frontend/instruments-page.spec.js | 17 +++++++++++++++++ .../gql/queries/instrumentsByTypeQuery.gql | 2 +- .../graphql/gql/queries/instrumentsQuery.gql | 16 ++++++---------- 3 files changed, 24 insertions(+), 11 deletions(-) create mode 100644 client/cypress/integration/frontend/instruments-page.spec.js diff --git a/client/cypress/integration/frontend/instruments-page.spec.js b/client/cypress/integration/frontend/instruments-page.spec.js new file mode 100644 index 00000000..1a7cfa19 --- /dev/null +++ b/client/cypress/integration/frontend/instruments-page.spec.js @@ -0,0 +1,17 @@ +describe('Instruments Page', () => { + beforeEach(() => { + cy.setup(); + }); + + it('opens the instruments page', () => { + cy.mockGraphqlOps({ + operations: { + MeQuery: {}, + InstrumentsQuery: { + instruments: [] + } + } + }); + cy.visit('instruments/'); + }); +}); diff --git a/client/src/graphql/gql/queries/instrumentsByTypeQuery.gql b/client/src/graphql/gql/queries/instrumentsByTypeQuery.gql index 6024c799..aa84aca6 100644 --- a/client/src/graphql/gql/queries/instrumentsByTypeQuery.gql +++ b/client/src/graphql/gql/queries/instrumentsByTypeQuery.gql @@ -1,4 +1,4 @@ -query InstrumentQuery($type: String!){ +query InstrumentsQuery($type: String!){ instruments(type: $type) { edges { node { diff --git a/client/src/graphql/gql/queries/instrumentsQuery.gql b/client/src/graphql/gql/queries/instrumentsQuery.gql index bed2a520..c87588ba 100644 --- a/client/src/graphql/gql/queries/instrumentsQuery.gql +++ b/client/src/graphql/gql/queries/instrumentsQuery.gql @@ -1,13 +1,9 @@ -query InstrumentQuery { +query InstrumentsQuery { instruments { - edges { - node { - id - title - contents - slug - type - } - } + id + title + contents + slug + type } }