import { CustomersState } from './customers.state';
import { customersStateMock } from './mocks';
import * as CustomersSelectors from './customers.selectors';
import { Dictionary } from '@cmf/core';
import { Customer } from './defs';

fdescribe('#CustomersSelectors', () => {
  let entities: Dictionary<Customer>;

  describe('selectGeneralAddress', () => {
    beforeEach(() => {
      entities = customersStateMock.entities;
    });
    it('should select the general address for the provided customerId', () => {
      const id = 123;

      expect(CustomersSelectors.selectGeneralAddress.projector(entities, 123)).toEqual(entities[id].addresses.generalAddress);
    });
  });
});
