var handleModalsRoute = require('cartodb3/routes/handle-modals-route');

describe('routes/handleModalsRoute', function () {
  it('should handle modals route', function () {
    var modals = jasmine.createSpyObj('modals', ['destroy']);

    handleModalsRoute(['layer_analyses', 'l1-1', 'a1', null], modals);

    expect(modals.destroy).toHaveBeenCalled();
  });
});

@@ -353,13 +353,379 @@
 );%0A  %7D);
+%0A%0A  it('should not destroy modals when route changes and %60keepOnRouteChange%60 property is enabled', function () %7B%0A    var modals = %7B%0A      keepOnRouteChange: function () %7B return true %7D,%0A      destroy: jasmine.createSpy('destroy')%0A    %7D;%0A%0A    handleModalsRoute(%5B'layer_analyses', 'l1-1', 'a1', null%5D, modals);%0A%0A    expect(modals.destroy).not.toHaveBeenCalled();%0A  %7D);
 %0A%7D);%0A

Add tests for keepOnRouteChange property