src/app/lib/utilities/getMasterbrand/index.test.js

Summary

Maintainability
A
0 mins
Test Coverage
import getMasterbrand from '.';

describe('getMasterbrand', () => {
  const brand = 'brand';
  const assetId = 'liveradio';

  it('should find value', () => {
    const masterbrand = getMasterbrand('liveradio', {
      masterBrand: {
        liveradio: brand,
      },
    });
    expect(masterbrand).toBe(brand);
  });

  it('should not find value and use external id', () => {
    const masterbrand = getMasterbrand(assetId, {
      masterBrand: {
        nothing: brand,
      },
    });
    expect(masterbrand).toBe(assetId);
  });
});