Skip to content

Commit

Permalink
Corrected tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
bm64 committed Dec 9, 2024
1 parent cf63b9e commit aa4ae55
Showing 1 changed file with 37 additions and 17 deletions.
54 changes: 37 additions & 17 deletions tests/SecurityDetails/SecurityDetailsConnector.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,20 +47,25 @@ export async function securityDetailsLoad (
id: 'F0GBR050DD',
isin: 'GB0004460357'
}
)
);
}

const AssetAllocationsConnector = new MC.SecurityDetailsConnector({
export async function assetAllocationsLoad (
api: MC.Shared.MorningstarAPIOptions
) {
const connector = new MC.SecurityDetailsConnector({
api,
security: {
id: 'F0GBR050DD',
idType: 'MSID'
}
},
type: 'AssetAllocations'
});

await AssetAllocationsConnector.load();
await connector.load();

Assert.deepStrictEqual(
AssetAllocationsConnector.table.getColumnNames(),
connector.table.getColumnNames(),
[
'AssetAllocations_Type',
'AssetAllocations_MorningstarEUR3_L',
Expand All @@ -69,19 +74,24 @@ export async function securityDetailsLoad (
],
'Asset allocations table should exist of expected columns.'
);
}

const RegionalExposureConnector = new MC.SecurityDetailsConnector({
export async function regionalExposureLoad (
api: MC.Shared.MorningstarAPIOptions
) {
const connector = new MC.SecurityDetailsConnector({
api,
security: {
id: 'F0GBR050DD',
idType: 'MSID'
}
},
type: 'RegionalExposure'
});

await RegionalExposureConnector.load();
await connector.load();

Assert.deepStrictEqual(
RegionalExposureConnector.table.getColumnNames(),
connector.table.getColumnNames(),
[
'RegionalExposure_Type',
'RegionalExposure_L_0.64368',
Expand All @@ -90,19 +100,24 @@ export async function securityDetailsLoad (
],
'Regional exposure table should exist of expected columns.'
);
}

const GlobalStockSectorBreakdownConnector = new MC.SecurityDetailsConnector({
export async function globalStockSectorBreakdownLoad (
api: MC.Shared.MorningstarAPIOptions
) {
const connector = new MC.SecurityDetailsConnector({
api,
security: {
id: 'F0GBR050DD',
idType: 'MSID'
}
},
type: 'GlobalStockSectorBreakdown'
});

await GlobalStockSectorBreakdownConnector.load();
await connector.load();

Assert.deepStrictEqual(
GlobalStockSectorBreakdownConnector.table.getColumnNames(),
connector.table.getColumnNames(),
[
'GlobalStockSectorBreakdown_Type',
'GlobalStockSectorBreakdown_L_0.64369',
Expand All @@ -111,19 +126,24 @@ export async function securityDetailsLoad (
],
'Global stock sector breakdown table should exist of expected columns.'
);
}

const CountryExposureConnector = new MC.SecurityDetailsConnector({
export async function countryExposureLoad (
api: MC.Shared.MorningstarAPIOptions
) {
const connector = new MC.SecurityDetailsConnector({
api,
security: {
id: 'F0GBR050DD',
idType: 'MSID'
}
},
type: 'CountryExposure'
});

await CountryExposureConnector.load();
await connector.load();

Assert.deepStrictEqual(
CountryExposureConnector.table.getColumnNames(),
connector.table.getColumnNames(),
[
'CountryExposure_Type',
'CountryExposure_Bond_L_99.98311',
Expand Down

0 comments on commit aa4ae55

Please sign in to comment.