"use strict";

var _updateArrayWithDefault = require("../updateArrayWithDefault");

describe('getArrayWithDefault', () => {
  const defaultValuesArray = ['a', 'b', 'c', 'd', 'e'];
  it('usual extra one option in the last', () => {
    const values = (0, _updateArrayWithDefault.getArrayWithDefault)(['...', 'z'], defaultValuesArray);
    const expectedValue = ['a', 'b', 'c', 'd', 'e', 'z'];
    expect(values).toEqual(expectedValue);
  });
  it('usual extra 2 option in the last', () => {
    const values = (0, _updateArrayWithDefault.getArrayWithDefault)(['...', 'z', 'y'], defaultValuesArray);
    const expectedValue = ['a', 'b', 'c', 'd', 'e', 'z', 'y'];
    expect(values).toEqual(expectedValue);
  });
  it('usual extra one option in the front', () => {
    const values = (0, _updateArrayWithDefault.getArrayWithDefault)(['z', '...'], defaultValuesArray);
    const expectedValue = ['z', 'a', 'b', 'c', 'd', 'e'];
    expect(values).toEqual(expectedValue);
  });
  it('usual extra 2 option in the front', () => {
    const values = (0, _updateArrayWithDefault.getArrayWithDefault)(['z', 'y', '...'], defaultValuesArray);
    const expectedValue = ['z', 'y', 'a', 'b', 'c', 'd', 'e'];
    expect(values).toEqual(expectedValue);
  });
  it('usual already given one option in the last', () => {
    const values = (0, _updateArrayWithDefault.getArrayWithDefault)(['...', 'c'], defaultValuesArray);
    const expectedValue = ['a', 'b', 'd', 'e', 'c'];
    expect(values).toEqual(expectedValue);
  });
  it('usual already given 2 option in the last', () => {
    const values = (0, _updateArrayWithDefault.getArrayWithDefault)(['...', 'd', 'b'], defaultValuesArray);
    const expectedValue = ['a', 'c', 'e', 'd', 'b'];
    expect(values).toEqual(expectedValue);
  });
  it('usual already given one option in the front', () => {
    const values = (0, _updateArrayWithDefault.getArrayWithDefault)(['c', '...'], defaultValuesArray);
    const expectedValue = ['c', 'a', 'b', 'd', 'e'];
    expect(values).toEqual(expectedValue);
  });
  it('usual already given 2 option in the front', () => {
    const values = (0, _updateArrayWithDefault.getArrayWithDefault)(['b', 'd', '...'], defaultValuesArray);
    const expectedValue = ['b', 'd', 'a', 'c', 'e'];
    expect(values).toEqual(expectedValue);
  });
});