Fix tests

Signed-off-by: Tomas Dabasinskas <tomas@dabasinskas.net>
This commit is contained in:
Tomas Dabasinskas
2023-02-27 09:11:44 +02:00
parent c4bdec7d49
commit b983893637
3 changed files with 7 additions and 7 deletions
@@ -166,10 +166,10 @@ describe('PuppetEntityProvider', () => {
[ANNOTATION_PUPPET_CERTNAME]: 'node1',
[ANNOTATION_LOCATION]: `url:${config.getString(
'catalog.providers.puppetdb.host',
)}${ENDPOINT_NODES}/node1`,
)}/${ENDPOINT_NODES}/node1`,
[ANNOTATION_ORIGIN_LOCATION]: `url:${config.getString(
'catalog.providers.puppetdb.host',
)}${ENDPOINT_NODES}/node1`,
)}/${ENDPOINT_NODES}/node1`,
},
tags: ['windows'],
description: 'Description 1',
@@ -194,10 +194,10 @@ describe('PuppetEntityProvider', () => {
[ANNOTATION_PUPPET_CERTNAME]: 'node2',
[ANNOTATION_LOCATION]: `url:${config.getString(
'catalog.providers.puppetdb.host',
)}${ENDPOINT_NODES}/node2`,
)}/${ENDPOINT_NODES}/node2`,
[ANNOTATION_ORIGIN_LOCATION]: `url:${config.getString(
'catalog.providers.puppetdb.host',
)}${ENDPOINT_NODES}/node2`,
)}/${ENDPOINT_NODES}/node2`,
},
tags: ['linux'],
description: 'Description 2',
@@ -24,12 +24,12 @@ export const ANNOTATION_PUPPET_CERTNAME = 'puppet.com/certname';
/**
* Path of PuppetDB FactSets endpoint.
*/
export const ENDPOINT_FACTSETS = '/pdb/query/v4/factsets';
export const ENDPOINT_FACTSETS = 'pdb/query/v4/factsets';
/**
* Path of PuppetDB Nodes endpoint.
*/
export const ENDPOINT_NODES = '/pdb/query/v4/nodes';
export const ENDPOINT_NODES = 'pdb/query/v4/nodes';
/**
* Default owner for entities created by the PuppetDB provider.
@@ -222,7 +222,7 @@ describe('readPuppetNodes', () => {
it('should return matched results', async () => {
const entities = await readPuppetNodes(config);
expect(mockFetch).toHaveBeenCalledWith(
`${config.host}${ENDPOINT_FACTSETS}?query=%5B%22%3D%22%2C+%22certname%22%2C+%22node1%22%5D`,
`${config.host}/${ENDPOINT_FACTSETS}?query=%5B%22%3D%22%2C+%22certname%22%2C+%22node1%22%5D`,
{
headers: {
Accept: 'application/json',