|
|
@@ -105,6 +105,44 @@ describe('happy path', () => { |
|
|
|
}); |
|
|
|
})); |
|
|
|
|
|
|
|
describe.skip('querying collections', () => { |
|
|
|
beforeEach(() => { |
|
|
|
vi |
|
|
|
.spyOn(DummyDataSource.prototype, 'getMultiple') |
|
|
|
.mockResolvedValueOnce([] as never); |
|
|
|
}); |
|
|
|
|
|
|
|
beforeEach(() => { |
|
|
|
Piano.canFetchCollection(); |
|
|
|
}); |
|
|
|
|
|
|
|
afterEach(() => { |
|
|
|
Piano.canFetchCollection(false); |
|
|
|
}); |
|
|
|
|
|
|
|
it('returns data', async () => { |
|
|
|
const [res, resData] = await client({ |
|
|
|
method: 'QUERY', |
|
|
|
path: `${BASE_PATH}/pianos`, |
|
|
|
headers: { |
|
|
|
'content-type': 'application/x-www-form-urlencoded', |
|
|
|
}, |
|
|
|
body: 'foo=bar', |
|
|
|
}); |
|
|
|
|
|
|
|
expect(res).toHaveProperty('statusCode', constants.HTTP_STATUS_OK); |
|
|
|
expect(res).toHaveProperty('statusMessage', prepareStatusMessage(TEST_LANGUAGE.statusMessages.resourceCollectionFetched)); |
|
|
|
expect(res.headers).toHaveProperty('content-type', expect.stringContaining(ACCEPT)); |
|
|
|
|
|
|
|
if (typeof resData === 'undefined') { |
|
|
|
expect.fail('Response body must be defined.'); |
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
|
expect(resData).toEqual([]); |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
describe('serving collections', () => { |
|
|
|
beforeEach(() => { |
|
|
|
vi |
|
|
|