Welcome to mirror list, hosted at ThFree Co, Russian Federation.

test.js « protractor « tests « ng-dialog « node_modules - github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 168a17153c84230fcfb5d86a4780b08a712bc3f4 (plain)
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
describe('ngDialog', function() {
  beforeEach(function() {
    browser.get('http://localhost:3000/example/paddingTest.html');
  });

  it('should add padding to the body tag when a scrollbar is present', function() {
    expect( $('body').getCssValue('padding-right') ).toBe( '0px' );
    $('.openPaddingLink').click();
    browser.sleep( 500 );
    expect(element(by.css('body')).getCssValue('padding-right')).not.toMatch(/[0-9]{,2}px/);
    $('.ngdialog-overlay').click();
    browser.sleep( 500 );
    expect(element(by.css('body')).getCssValue('padding-right')).toBe( '0px' );
  });

  it('should communicate the body padding to the application', function() {
    expect(element(by.css('body')).getCssValue('padding-right')).toBe( '0px' );
    expect(element(by.css('body')).getCssValue('padding-right')).toBe( element(by.css('.paddingHeader')).getCssValue('padding-right') );
    $('.openPaddingLink').click();
    browser.sleep( 500 );
    expect(element(by.css('body')).getCssValue('padding-right')).not.toMatch(/[0-9]{,2}px/);
    expect(element(by.css('body')).getCssValue('padding-right')).toBe( element(by.css('.paddingHeader')).getCssValue('padding-right') );
    $('.ngdialog-overlay').click();
    browser.sleep( 500 );
    expect(element(by.css('body')).getCssValue('padding-right')).toBe( '0px' );
    expect(element(by.css('body')).getCssValue('padding-right')).toBe( element(by.css('.paddingHeader')).getCssValue('padding-right') );
  });
});