fix(gateway): split profile identity from scenario
This commit is contained in:
@@ -6,25 +6,25 @@ describe('orderGatewayProfiles', () => {
|
||||
it('uses the public server order instead of alphabetical profile order', () => {
|
||||
const profiles = ['hwe', 'pya', 'che', 'nya', 'twe', 'pwe', 'kwe'].map((profile) => ({
|
||||
profile,
|
||||
scenario: 'default',
|
||||
instanceKey: 'default',
|
||||
}));
|
||||
|
||||
expect(orderGatewayProfiles(profiles).map(({ profile }) => profile)).toEqual(GATEWAY_PROFILE_ORDER);
|
||||
});
|
||||
|
||||
it('orders scenarios within a profile and places unknown profiles afterward', () => {
|
||||
it('orders instance keys within a profile and places unknown profiles afterward', () => {
|
||||
const profiles = [
|
||||
{ profile: 'zeta', scenario: 'default' },
|
||||
{ profile: 'che', scenario: '20' },
|
||||
{ profile: 'alpha', scenario: 'default' },
|
||||
{ profile: 'che', scenario: '10' },
|
||||
{ profile: 'zeta', instanceKey: 'default' },
|
||||
{ profile: 'che', instanceKey: '20' },
|
||||
{ profile: 'alpha', instanceKey: 'default' },
|
||||
{ profile: 'che', instanceKey: '10' },
|
||||
];
|
||||
|
||||
expect(orderGatewayProfiles(profiles)).toEqual([
|
||||
{ profile: 'che', scenario: '10' },
|
||||
{ profile: 'che', scenario: '20' },
|
||||
{ profile: 'alpha', scenario: 'default' },
|
||||
{ profile: 'zeta', scenario: 'default' },
|
||||
{ profile: 'che', instanceKey: '10' },
|
||||
{ profile: 'che', instanceKey: '20' },
|
||||
{ profile: 'alpha', instanceKey: 'default' },
|
||||
{ profile: 'zeta', instanceKey: 'default' },
|
||||
]);
|
||||
expect(profiles[0]?.profile).toBe('zeta');
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user