From aea15229b930191b12c38ae77ffe7b89b1227547 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wolfgang=20Hu=C3=9F?= Date: Wed, 22 Jun 2022 13:32:55 +0200 Subject: [PATCH] Fix location backend test --- .../schema/resolvers/users/location.spec.js | 40 ++++++++++--------- 1 file changed, 21 insertions(+), 19 deletions(-) diff --git a/backend/src/schema/resolvers/users/location.spec.js b/backend/src/schema/resolvers/users/location.spec.js index f150e85947..92f08893ea 100644 --- a/backend/src/schema/resolvers/users/location.spec.js +++ b/backend/src/schema/resolvers/users/location.spec.js @@ -119,25 +119,27 @@ describe('Location Service', () => { lang: 'en', } const result = await query({ query: queryLocations, variables }) - expect(result.data.queryLocations).toEqual([ - { id: 'place.14094307404564380', place_name: 'Berlin, Germany' }, - { - id: expect.stringMatching(/^place\.[0-9]+$/), - place_name: 'Berlin, Maryland, United States', - }, - { - id: expect.stringMatching(/^place\.[0-9]+$/), - place_name: 'Berlin, Connecticut, United States', - }, - { - id: expect.stringMatching(/^place\.[0-9]+$/), - place_name: 'Berlin, New Jersey, United States', - }, - { - id: expect.stringMatching(/^place\.[0-9]+$/), - place_name: 'Berlin Heights, Ohio, United States', - }, - ]) + expect(result.data.queryLocations).toEqual( + expect.arrayContaining([ + { id: 'place.14094307404564380', place_name: 'Berlin, Germany' }, + { + id: expect.stringMatching(/^place\.[0-9]+$/), + place_name: 'Berlin, Maryland, United States', + }, + { + id: expect.stringMatching(/^place\.[0-9]+$/), + place_name: 'Berlin, Connecticut, United States', + }, + { + id: expect.stringMatching(/^place\.[0-9]+$/), + place_name: 'Berlin, New Jersey, United States', + }, + { + id: expect.stringMatching(/^place\.[0-9]+$/), + place_name: 'Berlin Heights, Ohio, United States', + }, + ]), + ) }) it('query Location existing in different language', async () => {