Skip to content

Commit

Permalink
AT-10914: Fix duplicates
Browse files Browse the repository at this point in the history
  • Loading branch information
rddimon committed Dec 1, 2023
1 parent 08ec346 commit a856cea
Showing 1 changed file with 9 additions and 39 deletions.
48 changes: 9 additions & 39 deletions test/unit-tests/aws/route53-wrapper.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -165,19 +165,24 @@ describe("Route53 wrapper checks", () => {
{
CallerReference: "",
Config: {PrivateZone: false},
Id: testId,
Name: "test_domain",
Id: "no_valid",
Name: "api.test_domain",
}, {
CallerReference: "",
Config: {PrivateZone: true},
Id: "dummy_host_id",
Name: "test_domain",
}
}, {
CallerReference: "",
Config: {PrivateZone: false},
Id: testId,
Name: "test_domain",
},
]
});

const dc = new DomainConfig(getDomainConfig({
domainName: "test_domain"
domainName: "devapi.test_domain"
}));

const actualId = await new Route53Wrapper().getRoute53HostedZoneId(dc, false);
Expand Down Expand Up @@ -217,41 +222,6 @@ describe("Route53 wrapper checks", () => {
expect(commandCalls.length).to.equal(1);
});

it("get route53 hosted zones with overlaps", async () => {
const testId = "test_host_id"
const Route53Mock = mockClient(Route53Client);
Route53Mock.on(ListHostedZonesCommand).resolves({
HostedZones: [
{
CallerReference: "1",
Config: {PrivateZone: false},
Id: "dummy_host_id",
Name: "dummy_domain",
}, {
CallerReference: "2",
Config: {PrivateZone: false},
Id: "not_valid",
Name: "api.test_domain",
}, {
CallerReference: "3",
Config: {PrivateZone: false},
Id: testId,
Name: "test_domain",
}
]
});

const dc = new DomainConfig(getDomainConfig({
domainName: "devapi.test_domain"
}));

const actualId = await new Route53Wrapper().getRoute53HostedZoneId(dc);
expect(actualId).to.equal(testId);

const commandCalls = Route53Mock.commandCalls(ListHostedZonesCommand, {});
expect(commandCalls.length).to.equal(1);
});

it("get route53 hosted zone id failure", async () => {
const Route53Mock = mockClient(Route53Client);
Route53Mock.on(ListHostedZonesCommand).rejects(null);
Expand Down

0 comments on commit a856cea

Please sign in to comment.