diff options
| author | Ola Bini <ola.bini@gmail.com> | 2014-07-31 19:29:33 -0300 | 
|---|---|---|
| committer | Ola Bini <ola.bini@gmail.com> | 2014-07-31 19:29:33 -0300 | 
| commit | 04cf441c5ae18400c6b4865b0b37a71718dc9d46 (patch) | |
| tree | dd0b0d049ec00389e2d4561b226c46eb1682b997 /web-ui/test/spec/page/pane_contract_expand.spec.js | |
| parent | 639a663a4c37020003586438fdcd7ac529a00f10 (diff) | |
Add web-ui based on previous code
Diffstat (limited to 'web-ui/test/spec/page/pane_contract_expand.spec.js')
| -rw-r--r-- | web-ui/test/spec/page/pane_contract_expand.spec.js | 67 | 
1 files changed, 67 insertions, 0 deletions
| diff --git a/web-ui/test/spec/page/pane_contract_expand.spec.js b/web-ui/test/spec/page/pane_contract_expand.spec.js new file mode 100644 index 00000000..803f688c --- /dev/null +++ b/web-ui/test/spec/page/pane_contract_expand.spec.js @@ -0,0 +1,67 @@ +/*global Smail */ +/*global afterEach */ + +'use strict'; + +describeComponent('page/pane_contract_expand', function () { + +  var fixture; + +  beforeEach(function () { +    fixture = $('<div>') +      .append($('<div>', { id: 'middle-pane-container' })) +      .append($('<div>', { id: 'right-pane' })); + +    $('body').append(fixture); + + +  }); + +  afterEach(function () { +    fixture.remove(); +  }); + +  describe('after initialization', function () { +    beforeEach(function () { +      setupComponent(document); +    }); + +    it('contracts middle pane and expands right pane on mail open', function () { +      $(document).trigger(Smail.events.ui.mail.open); + +      expect($('#middle-pane-container').attr('class')).toEqual(this.component.attr.MIDDLE_PANE_CONTRACT_CLASSES); +      expect($('#right-pane').attr('class')).toEqual(this.component.attr.RIGHT_PANE_EXPAND_CLASSES); +    }); + +    it('contracts middle pane and expands right pane on open compose box', function () { +      $(document).trigger(Smail.events.dispatchers.rightPane.openComposeBox); + +      expect($('#middle-pane-container').attr('class')).toEqual(this.component.attr.MIDDLE_PANE_CONTRACT_CLASSES); +      expect($('#right-pane').attr('class')).toEqual(this.component.attr.RIGHT_PANE_EXPAND_CLASSES); +    }); + +    it('contracts middle pane and expands right pane on open draft', function () { +      $(document).trigger(Smail.events.dispatchers.rightPane.openDraft); + +      expect($('#middle-pane-container').attr('class')).toEqual(this.component.attr.MIDDLE_PANE_CONTRACT_CLASSES); +      expect($('#right-pane').attr('class')).toEqual(this.component.attr.RIGHT_PANE_EXPAND_CLASSES); +    }); + +    it('expands middle pane and contracts right pane on event on open no message selected pane', function () { +      $(document).trigger(Smail.events.dispatchers.rightPane.openNoMessageSelected); + +      expect($('#middle-pane-container').attr('class')).toEqual(this.component.attr.MIDDLE_PANE_EXPAND_CLASSES); +      expect($('#right-pane').attr('class')).toEqual(this.component.attr.RIGHT_PANE_CONTRACT_CLASSES); +    }); +  }); + +  describe('on initialization', function () { +    it('expands middle pane and contracts right pane', function () { +      setupComponent(document); + +      expect($('#middle-pane-container').attr('class')).toEqual(this.component.attr.MIDDLE_PANE_EXPAND_CLASSES); +      expect($('#right-pane').attr('class')).toEqual(this.component.attr.RIGHT_PANE_CONTRACT_CLASSES); +    }); +  }); + +}); | 
