Skip to content

Commit 1c00a5d

Browse files
BryanTabarezbryan-tabarez
andauthored
Yard resolucion: Add unit test (#265)
Co-authored-by: bryan-tabarez <[email protected]>
1 parent 1c77db2 commit 1c00a5d

File tree

3 files changed

+18
-2
lines changed

3 files changed

+18
-2
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@al/core",
3-
"version": "1.0.200",
3+
"version": "1.0.201",
44
"description": "Node Enterprise Packages for Alert Logic (NEPAL) Core Library",
55
"main": "./dist/index.cjs.js",
66
"types": "./dist/index.d.ts",

src/common/navigation/al-location.dictionary.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -594,20 +594,23 @@ export const AlLocationDictionary: AlLocationDescriptor[] =
594594
*/
595595
{
596596
locTypeId: AlLocation.YARDAPI,
597+
aspect: 'api',
597598
insightLocationId: 'defender-us-denver',
598599
uri: 'https://yard.alertlogic.com',
599600
environment: 'production|production-staging',
600601
residency: "US"
601602
},
602603
{
603604
locTypeId: AlLocation.YARDAPI,
605+
aspect: 'api',
604606
insightLocationId: 'defender-us-ashburn',
605607
uri: 'https://yard.alertlogic.net',
606608
environment: 'production|production-staging',
607609
residency: "US"
608610
},
609611
{
610612
locTypeId: AlLocation.YARDAPI,
613+
aspect: 'api',
611614
insightLocationId: 'defender-uk-newport',
612615
uri: 'https://yard.alertlogic.co.uk',
613616
environment: 'production|production-staging',

test/client/al-api-client.spec.ts

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -528,8 +528,21 @@ describe("AlDefaultClient", () => {
528528

529529
} );
530530
} );
531+
describe('for a YARD API Endpoint', () => {
532+
it('should properly resolve the full URL', async () => {
533+
const config: APIRequestParams = {
534+
service_stack: AlLocation.YARDAPI,
535+
version: 1,
536+
account_id: "12345678",
537+
path: '/something/wicked',
538+
params: { 'this-way': 'comes' },
539+
method: 'GET',
540+
};
541+
let fullURL = await AlDefaultClient.fromConfigToFullUrl(config);
542+
expect(fullURL).to.equal("https://yard.alertlogic.co.uk/v1/12345678/something/wicked?this-way=comes");
543+
});
544+
});
531545
});
532-
533546
describe('when flushCacheKeys is present',() => {
534547
let flushSpy;
535548
let cabinetStorage;

0 commit comments

Comments
 (0)