import { checkForInactiveOperatorToplist } from './validateData';

describe('checkForInactiveOperatorToplist', () => {
  it('should not return anything if the item is an active toplist with short code inactive_operator_toplist', () => {
    const item = {
      name: 'top_list',
      items: [{ short_code: 'inactive_operator_toplist' }],
    };
    const status = 'active';
    expect(checkForInactiveOperatorToplist(item, status)).toBe(true);
  });

  it('should return anything if the item is not a toplist', () => {
    const item = {
      name: 'not_top_list',
      items: [{ short_code: 'inactive_operator_toplist' }],
    };
    const status = 'active';
    expect(checkForInactiveOperatorToplist(item, status)).toBe(false);
  });

  it('should return anything if the item is not active', () => {
    const item = {
      name: 'top_list',
      items: [{ short_code: 'inactive_operator_toplist' }],
    };
    const status = 'inactive';
    expect(checkForInactiveOperatorToplist(item, status)).toBe(false);
  });

  it('should return anything if the short_code is not inactive_operator_toplist', () => {
    const item = {
      name: 'top_list',
      items: [{ short_code: 'not_inactive_operator_toplist' }],
    };
    const status = 'active';
    expect(checkForInactiveOperatorToplist(item, status)).toBe(false);
  });
});
