|
1 | 1 | import { AppPage } from './app.po'; |
2 | 2 | import { browser, element, by } from 'protractor'; |
3 | 3 |
|
4 | | -describe('ScrollCollapse Lib E2E Tests', function () { |
| 4 | +describe('ScrollCollapse Lib E2E Tests', function() { |
5 | 5 | let page: AppPage; |
6 | 6 |
|
7 | | - beforeEach(() => page = new AppPage()); |
| 7 | + beforeEach(() => (page = new AppPage())); |
8 | 8 |
|
9 | 9 | beforeEach(() => page.navigateTo()); |
10 | 10 |
|
11 | 11 | beforeEach(() => browser.executeScript('window.scrollTo(0,0)')); |
12 | 12 |
|
13 | 13 | afterEach(() => { |
14 | | - browser.manage().logs().get('browser').then((browserLog: any[]) => { |
15 | | - expect(browserLog).toEqual([]); |
16 | | - }); |
| 14 | + browser |
| 15 | + .manage() |
| 16 | + .logs() |
| 17 | + .get('browser') |
| 18 | + .then((browserLog: any[]) => { |
| 19 | + expect(browserLog).toEqual([]); |
| 20 | + }); |
17 | 21 | }); |
18 | 22 |
|
19 | 23 | describe('scroll direction', () => { |
20 | 24 | it('should add scrolling direction class', () => { |
21 | 25 | page.scrollTo(); |
22 | | - expect(page.getNavElement().getAttribute('class')).not.toContain('sn-scrolling-down'); |
23 | | - expect(page.getNavElement().getAttribute('class')).not.toContain('sn-scrolling-up'); |
| 26 | + expect(page.getNavElement().getAttribute('class')).not.toContain( |
| 27 | + 'sn-scrolling-down' |
| 28 | + ); |
| 29 | + expect(page.getNavElement().getAttribute('class')).not.toContain( |
| 30 | + 'sn-scrolling-up' |
| 31 | + ); |
24 | 32 |
|
25 | 33 | page.scrollTo(0, 10); |
26 | 34 | page.scrollTo(0, 200); |
27 | | - expect(page.getNavElement().getAttribute('class')).toContain('sn-scrolling-down'); |
28 | | - expect(page.getNavElement().getAttribute('class')).not.toContain('sn-scrolling-up'); |
29 | | - |
| 35 | + expect(page.getNavElement().getAttribute('class')).toContain( |
| 36 | + 'sn-scrolling-down' |
| 37 | + ); |
| 38 | + expect(page.getNavElement().getAttribute('class')).not.toContain( |
| 39 | + 'sn-scrolling-up' |
| 40 | + ); |
30 | 41 |
|
31 | 42 | page.scrollTo(0, 100); |
32 | | - expect(page.getNavElement().getAttribute('class')).not.toContain('sn-scrolling-down'); |
33 | | - expect(page.getNavElement().getAttribute('class')).toContain('sn-scrolling-up'); |
| 43 | + expect(page.getNavElement().getAttribute('class')).not.toContain( |
| 44 | + 'sn-scrolling-down' |
| 45 | + ); |
| 46 | + expect(page.getNavElement().getAttribute('class')).toContain( |
| 47 | + 'sn-scrolling-up' |
| 48 | + ); |
34 | 49 | }); |
35 | 50 | }); |
36 | 51 |
|
37 | 52 | describe('minimise mode', () => { |
38 | 53 | it('should add "sn-minimise" class', () => { |
39 | 54 | page.scrollTo(); |
40 | 55 | page.scrollTo(0, 10); |
41 | | - expect(page.getNavElement().getAttribute('class')).not.toContain('sn-minimise'); |
| 56 | + expect(page.getNavElement().getAttribute('class')).not.toContain( |
| 57 | + 'sn-minimise' |
| 58 | + ); |
42 | 59 |
|
43 | 60 | page.scrollTo(0, 110); |
44 | | - expect(page.getNavElement().getAttribute('class')).toContain('sn-minimise'); |
| 61 | + expect(page.getNavElement().getAttribute('class')).toContain( |
| 62 | + 'sn-minimise' |
| 63 | + ); |
45 | 64 | }); |
46 | 65 | }); |
47 | 66 |
|
48 | 67 | describe('affix mode', () => { |
49 | 68 | it('should add "sn-affix" class', () => { |
50 | 69 | page.scrollTo(); |
51 | 70 | page.scrollTo(0, 10); |
52 | | - expect(page.getBarElement().getAttribute('class')).not.toContain('sn-affix'); |
| 71 | + expect(page.getBarElement().getAttribute('class')).not.toContain( |
| 72 | + 'sn-affix' |
| 73 | + ); |
53 | 74 |
|
54 | 75 | page.scrollTo(0, 768 * 3); |
55 | 76 | expect(page.getBarElement().getAttribute('class')).toContain('sn-affix'); |
56 | 77 | }); |
57 | 78 | }); |
58 | | - |
59 | 79 | }); |
0 commit comments