diff options
Diffstat (limited to 'node_modules/ng-dialog/tests/protractor/test.js')
-rw-r--r-- | node_modules/ng-dialog/tests/protractor/test.js | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/node_modules/ng-dialog/tests/protractor/test.js b/node_modules/ng-dialog/tests/protractor/test.js new file mode 100644 index 0000000000..168a17153c --- /dev/null +++ b/node_modules/ng-dialog/tests/protractor/test.js @@ -0,0 +1,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') ); + }); +}); |