import WsMultipleInputController from './ws-multiple-input.controller';

describe('WsMultipleInputController', () => {
  let controller;

  beforeEach(() => {
    controller = new WsMultipleInputController();
    controller.$onInit();
    controller.onCompleted = () => true;
    controller.isReadonly = false;
  });

  it('should call onCompleted when all elements are populated', () => {
    controller.inputCount = 3;
    controller.model.inputs = ['1', '2', '3'];

    spyOn(controller, 'onCompleted');

    controller.onKeyUp({ target: { value: '3', maxLength: 1 } });
    expect(controller.onCompleted).toHaveBeenCalledWith('123');
  });
});
