Skip to content

Commit 6b6f2f2

Browse files
BryanTabarezbryan-tabarez
andauthored
Updated YARD unit tests - added UK, denver case (#266)
Co-authored-by: bryan-tabarez <[email protected]>
1 parent 1c00a5d commit 6b6f2f2

File tree

3 files changed

+16
-2
lines changed

3 files changed

+16
-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.201",
3+
"version": "1.0.202",
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: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -614,7 +614,7 @@ export const AlLocationDictionary: AlLocationDescriptor[] =
614614
insightLocationId: 'defender-uk-newport',
615615
uri: 'https://yard.alertlogic.co.uk',
616616
environment: 'production|production-staging',
617-
residency: "UK"
617+
residency: "EMEA"
618618
},
619619
];
620620

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

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -530,6 +530,7 @@ describe("AlDefaultClient", () => {
530530
} );
531531
describe('for a YARD API Endpoint', () => {
532532
it('should properly resolve the full URL', async () => {
533+
AlLocatorService.setContext( { environment:'production', residency: 'EMEA', insightLocationId: 'defender-uk-newport' } );
533534
const config: APIRequestParams = {
534535
service_stack: AlLocation.YARDAPI,
535536
version: 1,
@@ -541,6 +542,19 @@ describe("AlDefaultClient", () => {
541542
let fullURL = await AlDefaultClient.fromConfigToFullUrl(config);
542543
expect(fullURL).to.equal("https://yard.alertlogic.co.uk/v1/12345678/something/wicked?this-way=comes");
543544
});
545+
it('should properly resolve the full URL in a different datacenter', async () => {
546+
AlLocatorService.setContext( { environment:'production', residency: 'US', insightLocationId: 'defender-us-denver' } );
547+
const config: APIRequestParams = {
548+
service_stack: AlLocation.YARDAPI,
549+
version: 1,
550+
account_id: "12345678",
551+
path: '/something/wicked',
552+
params: { 'this-way': 'comes' },
553+
method: 'GET',
554+
};
555+
let fullURL = await AlDefaultClient.fromConfigToFullUrl(config);
556+
expect(fullURL).to.equal("https://yard.alertlogic.com/v1/12345678/something/wicked?this-way=comes");
557+
});
544558
});
545559
});
546560
describe('when flushCacheKeys is present',() => {

0 commit comments

Comments
 (0)