message: Added custom crumb trail array data test
diff: @@ -2065,6 +2065,66 @@ describe('Navigation Data', function () {
  }
  });
  + describe('Custom Trail Array Data', function() {
  + var stateNavigator: StateNavigator;
  + beforeEach(function() {
  + stateNavigator = new StateNavigator([
  + { key: 's', route: 'r', trackCrumbTrail: true },
  + ]);
  + var state = stateNavigator.states['s'];
  + state.truncateCrumbTrail = (state, crumbs, data) => {
  + if (data.array_string && data.array_string[0] === 'He-llo' && data.array_string[1] === 'World'
  + && data.array_boolean[0] === '' && data.array_boolean[1] === true && data.array_boolean[2] === false
  + && data.array_number[0] === 1 && data.array_number[1] === null && data.array_number[2] === undefined && data.array_number[3] === 2
  + && +data.array_date[0] === +new Date(2010, 3, 7) && +data.array_date[1] === +new Date(2011, 7, 3)
  + && data.array_blank[0] === '' && data.array_blank[1] === null && data.array_blank[2] === undefined)
  + return crumbs;
  + return [];
  + };
  + });
  + var arrayNavigationData = {};
  + arrayNavigationData['array_string'] = ['He-llo', 'World'];
  + arrayNavigationData['array_boolean'] = ['', true, false];
  + arrayNavigationData['array_number'] = [1, null, undefined, 2];
  + arrayNavigationData['array_date'] = [new Date(2010, 3, 7), new Date(2011, 7, 3)];
  + arrayNavigationData['array_blank'] = ['', null, undefined];
  +
  + describe('Navigate', function() {
  + beforeEach(function() {
  + stateNavigator.navigate('s');
  + stateNavigator.navigate('s', arrayNavigationData);
  + });
  + test();
  + });
  +
  + describe('Navigate Link', function() {
  + beforeEach(function() {
  + var link = stateNavigator.getNavigationLink('s');
  + stateNavigator.navigateLink(link);
  + link = stateNavigator.getNavigationLink('s', arrayNavigationData);
  + stateNavigator.navigateLink(link);
  + });
  + test();
  + });
  +
  + describe('Fluent Navigate', function() {
  + beforeEach(function() {
  + var link = stateNavigator.fluent()
  + .navigate('s')
  + .navigate('s', arrayNavigationData)
  + .url;
  + stateNavigator.navigateLink(link);
  + });
  + test();
  + });
  +
  + function test() {
  + it('should populate crumb trail', function() {
  + assert.equal(stateNavigator.stateContext.crumbs.length, 1);
  + });
  + }
  + });
  +
  describe('Defaults', function() {
  var stateNavigator: StateNavigator;
  beforeEach(function() {
  