From 152d088ff4015b955bffbf769c436dd44ba19541 Mon Sep 17 00:00:00 2001 From: Gregor Wolf Date: Fri, 12 Nov 2021 21:49:39 +0100 Subject: [PATCH] rename author to authorName --- test/localized-data.test.js | 36 ++++++++++++++++++------------------ test/odata.test.js | 10 +++++----- 2 files changed, 23 insertions(+), 23 deletions(-) diff --git a/test/localized-data.test.js b/test/localized-data.test.js index 4d399786..316ae9e4 100644 --- a/test/localized-data.test.js +++ b/test/localized-data.test.js @@ -11,39 +11,39 @@ describe('Localized Data', () => { }) it('supports sap-language param', async () => { - const { data } = await GET(`/browse/Books?$select=title,author` + '&sap-language=de') + const { data } = await GET(`/browse/Books?$select=title,authorName` + '&sap-language=de') expect(data.value).to.containSubset([ - { title: 'Sturmhöhe', author: 'Emily Brontë' }, - { title: 'Jane Eyre', author: 'Charlotte Brontë' }, - { title: 'The Raven', author: 'Edgar Allen Poe' }, - { title: 'Eleonora', author: 'Edgar Allen Poe' }, - { title: 'Catweazle', author: 'Richard Carpenter' }, + { title: 'Sturmhöhe', authorName: 'Emily Brontë' }, + { title: 'Jane Eyre', authorName: 'Charlotte Brontë' }, + { title: 'The Raven', authorName: 'Edgar Allen Poe' }, + { title: 'Eleonora', authorName: 'Edgar Allen Poe' }, + { title: 'Catweazle', authorName: 'Richard Carpenter' }, ]) }) it('supports accept-language header', async () => { - const { data } = await GET(`/browse/Books?$select=title,author`, { + const { data } = await GET(`/browse/Books?$select=title,authorName`, { headers: { 'Accept-Language': 'de' }, }) expect(data.value).to.containSubset([ - { title: 'Sturmhöhe', author: 'Emily Brontë' }, - { title: 'Jane Eyre', author: 'Charlotte Brontë' }, - { title: 'The Raven', author: 'Edgar Allen Poe' }, - { title: 'Eleonora', author: 'Edgar Allen Poe' }, - { title: 'Catweazle', author: 'Richard Carpenter' }, + { title: 'Sturmhöhe', authorName: 'Emily Brontë' }, + { title: 'Jane Eyre', authorName: 'Charlotte Brontë' }, + { title: 'The Raven', authorName: 'Edgar Allen Poe' }, + { title: 'Eleonora', authorName: 'Edgar Allen Poe' }, + { title: 'Catweazle', authorName: 'Richard Carpenter' }, ]) }) it('supports queries with $expand', async () => { - const { data } = await GET(`/browse/Books?&$select=title,author&$expand=currency`, { + const { data } = await GET(`/browse/Books?&$select=title,authorName&$expand=currency`, { headers: { 'Accept-Language': 'de' }, }) expect(data.value).to.containSubset([ - { title: 'Sturmhöhe', author: 'Emily Brontë', currency: { name: 'Pfund' } }, - { title: 'Jane Eyre', author: 'Charlotte Brontë', currency: { name: 'Pfund' } }, - { title: 'The Raven', author: 'Edgar Allen Poe', currency: { name: 'US-Dollar' } }, - { title: 'Eleonora', author: 'Edgar Allen Poe', currency: { name: 'US-Dollar' } }, - { title: 'Catweazle', author: 'Richard Carpenter', currency: { name: 'Yen' } }, + { title: 'Sturmhöhe', authorName: 'Emily Brontë', currency: { name: 'Pfund' } }, + { title: 'Jane Eyre', authorName: 'Charlotte Brontë', currency: { name: 'Pfund' } }, + { title: 'The Raven', authorName: 'Edgar Allen Poe', currency: { name: 'US-Dollar' } }, + { title: 'Eleonora', authorName: 'Edgar Allen Poe', currency: { name: 'US-Dollar' } }, + { title: 'Catweazle', authorName: 'Richard Carpenter', currency: { name: 'Yen' } }, ]) }) diff --git a/test/odata.test.js b/test/odata.test.js index 43b90791..ff1945f2 100644 --- a/test/odata.test.js +++ b/test/odata.test.js @@ -19,13 +19,13 @@ describe('OData Protocol', () => { it('supports $search in multiple fields', async () => { const { data } = await GET `/browse/Books ${{ - params: { $search: 'Po', $select: `title,author` }, + params: { $search: 'Po', $select: `title,authorName` }, }}` expect(data.value).to.eql([ - { ID: 201, title: 'Wuthering Heights', author: 'Emily Brontë' }, - { ID: 207, title: 'Jane Eyre', author: 'Charlotte Brontë' }, - { ID: 251, title: 'The Raven', author: 'Edgar Allen Poe' }, - { ID: 252, title: 'Eleonora', author: 'Edgar Allen Poe' }, + { ID: 201, title: 'Wuthering Heights', authorName: 'Emily Brontë' }, + { ID: 207, title: 'Jane Eyre', authorName: 'Charlotte Brontë' }, + { ID: 251, title: 'The Raven', authorName: 'Edgar Allen Poe' }, + { ID: 252, title: 'Eleonora', authorName: 'Edgar Allen Poe' }, ]) })