Sha256: 3a520a4f0065bc45b6604326a8b3f8fcee5aef65aa1bf1f070238ab4a63df3a6

Contents?: true

Size: 1.29 KB

Versions: 70

Compression:

Stored size: 1.29 KB

Contents

describe('Factory: PageTitle', function () {
    var $window, $interpolate, PageTitle;

    beforeEach(module('Bastion.components'));

    beforeEach(inject(function (_$window_, _$interpolate_, _PageTitle_) {
        $window = _$window_;
        $interpolate = _$interpolate_;
        PageTitle = _PageTitle_;
    }));

    it("provides a way to set titles", function () {
        PageTitle.setTitle("my new title: {{ title }}", {title: 'blah'})
        expect(PageTitle.titles.length).toBe(1);
        expect($window.document.title).toBe("my new title: blah");
    });

    it("provides a way to reset to the first title", function () {
        PageTitle.setTitle("my new title: {{ title }}", {title: 'blah'})
        PageTitle.setTitle('title 1');
        PageTitle.setTitle('title 2');

        PageTitle.resetToFirst();
        expect(PageTitle.titles.length).toBe(1);
        expect($window.document.title).toBe("my new title: blah");
    });

    it("stores a stack of titles and provides a way to retrieve it", function () {
        expect(PageTitle.titles.length).toBe(0);

        PageTitle.setTitle('title 1');
        expect(PageTitle.titles.length).toBe(1);

        PageTitle.setTitle('title 2');
        expect(PageTitle.titles.length).toBe(2);
        expect(PageTitle.titles[1]).toBe('title 2');
    })
});

Version data entries

70 entries across 70 versions & 1 rubygems

Version Path
bastion-6.1.3 test/components/page-title.service.test.js
bastion-6.1.2 test/components/page-title.service.test.js
bastion-5.1.1 test/components/page-title.service.test.js
bastion-6.1.1 test/components/page-title.service.test.js
bastion-6.1.0 test/components/page-title.service.test.js
bastion-6.0.0 test/components/page-title.service.test.js
bastion-5.1.0 test/components/page-title.service.test.js
bastion-5.0.10 test/components/page-title.service.test.js
bastion-5.0.9 test/components/page-title.service.test.js
bastion-5.0.8 test/components/page-title.service.test.js
bastion-5.0.7 test/components/page-title.service.test.js
bastion-5.0.6 test/components/page-title.service.test.js
bastion-5.0.5 test/components/page-title.service.test.js
bastion-5.0.4 test/components/page-title.service.test.js
bastion-5.0.3 test/components/page-title.service.test.js
bastion-5.0.2 test/components/page-title.service.test.js
bastion-5.0.1 test/components/page-title.service.test.js
bastion-5.0.0 test/components/page-title.service.test.js
bastion-4.3.1 test/components/page-title.service.test.js
bastion-4.3.0 test/components/page-title.service.test.js