23 lines
1002 B
TypeScript
23 lines
1002 B
TypeScript
import {
|
|
isChannelCarrierCompatible,
|
|
legacyCarrierFromCapabilities,
|
|
normalizeChannelCarriers,
|
|
} from './channels.helpers';
|
|
|
|
describe('channel carrier capabilities', () => {
|
|
it('preserves the legacy default when an old caller omits carrier fields', () => {
|
|
expect(normalizeChannelCarriers()).toEqual(['mobile']);
|
|
});
|
|
|
|
it('expands a historical three-network channel without inventing data for partial capabilities', () => {
|
|
expect(normalizeChannelCarriers(undefined, 'all')).toEqual(['mobile', 'unicom', 'telecom']);
|
|
expect(normalizeChannelCarriers(['telecom', 'mobile'], 'all')).toEqual(['mobile', 'telecom']);
|
|
expect(legacyCarrierFromCapabilities(['mobile', 'telecom'])).toBe('multi');
|
|
});
|
|
|
|
it('checks a group carrier against the new multi-select capability list', () => {
|
|
expect(isChannelCarrierCompatible('multi', 'mobile', ['mobile', 'telecom'])).toBe(true);
|
|
expect(isChannelCarrierCompatible('multi', 'unicom', ['mobile', 'telecom'])).toBe(false);
|
|
});
|
|
});
|