Blame view

src/app/layout/boxes/set-box-layout.filter.spec.ts 1.51 KB
886e0841   Tallys Martins   Adds support for ...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
import {SetBoxLayout} from './set-box-layout.filter';

describe("Boxes Filters", () => {
    describe("Set Box Layout Filter", () => {
        let box_layout_filter = new SetBoxLayout();
        describe("When layout is set to default", () =>  {
            it("return style when box position is 1 ", done => {
                expect(box_layout_filter.transform(1, "default")).toEqual("col-md-6 col-md-push-3");
                done();
            });
            it("return style when box position is 2", done => {
                expect(box_layout_filter.transform(2, "default")).toEqual("col-md-3 col-md-pull-6");
                done();
            });
            it("return style when any other position is given", done => {
                expect(box_layout_filter.transform(null, "default")).toEqual("col-md-3");
                expect(box_layout_filter.transform(3, "default")).toEqual("col-md-3");
                expect(box_layout_filter.transform(99, "default")).toEqual("col-md-3");
                done();
            });
       });

        describe("When layout is set to right_bar", () =>  {
            it("return style when box position is 1 ", done => {
                expect(box_layout_filter.transform(1, "rightbar")).toEqual("col-sm-12 col-md-8");
                done();
            });
            it("return style when box other position is given", done => {
                expect(box_layout_filter.transform(2, "rightbar")).toEqual("col-sm-12 col-md-4");
                done();
            });
        });
    });
});