diff options
Diffstat (limited to 'docs/component-spec/errorDisplaySpec.js')
| -rw-r--r-- | docs/component-spec/errorDisplaySpec.js | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/docs/component-spec/errorDisplaySpec.js b/docs/component-spec/errorDisplaySpec.js index 8122e253..9549e220 100644 --- a/docs/component-spec/errorDisplaySpec.js +++ b/docs/component-spec/errorDisplaySpec.js @@ -7,7 +7,7 @@ describe("errorDisplay", function () { beforeEach(inject(function ($injector) { var $rootScope = $injector.get('$rootScope'), $compile = $injector.get('$compile'); - + $location = $injector.get('$location'); compileHTML = function (code) { @@ -35,7 +35,7 @@ describe("errorDisplay", function () { }); it('should interpolate a template with no parameters when search parameters are present', function () { - var elm; + var elm; spyOn($location, 'search').andReturn({ p0: 'foobaz' }); elm = compileHTML('<div error-display="This is a test"></div>'); @@ -43,7 +43,7 @@ describe("errorDisplay", function () { }); it('should correctly interpolate search parameters', function () { - var elm; + var elm; spyOn($location, 'search').andReturn({ p0: '42' }); elm = compileHTML('<div error-display="The answer is {0}"></div>'); @@ -65,4 +65,12 @@ describe("errorDisplay", function () { elm = compileHTML('<div error-display="This {0} is {1} on {2}"></div>'); expect(elm).toInterpolateTo('This Fooooo is {1} on {2}'); }); + + it('should correctly handle the empty string as an interpolation parameter', function () { + var elm; + + spyOn($location, 'search').andReturn({ p0: 'test', p1: '' }); + elm = compileHTML('<div error-display="This {0} is a {1}"></div>'); + expect(elm).toInterpolateTo('This test is a '); + }); });
\ No newline at end of file |
