2
2
3
3
describe ( 'angular-bootstrap-slider' , function ( ) {
4
4
5
- beforeEach ( function ( ) {
6
- browser . get ( 'test.html' ) ;
7
- } ) ;
5
+ describe ( 'tooltip' , function ( ) {
6
+ var slider , handle , tooltip ;
8
7
9
- it ( 'should automatically redirect to /view1 when location hash/fragment is empty' , function ( ) {
10
- expect ( browser . getLocationAbsUrl ( ) ) . toMatch ( "/test.html" ) ;
11
- } ) ;
8
+ beforeEach ( function ( ) {
9
+ browser . get ( '/test.html' ) ;
10
+ browser . waitForAngular ( ) ;
11
+
12
+ slider = element ( by . css ( '[slider-id="tooltipSlider"]' ) ) ;
13
+ handle = slider . element ( by . css ( '.slider-handle.min-slider-handle' ) )
14
+ tooltip = slider . element ( by . css ( '.tooltip.tooltip-main' ) ) ;
15
+ } ) ;
16
+
17
+ it ( 'should be visible on hover' , function ( ) {
18
+ browser . actions ( ) . mouseMove ( handle ) . perform ( ) ;
19
+ expect ( tooltip . getAttribute ( 'class' ) ) . toMatch ( 'in' ) ;
20
+ } ) ;
21
+
22
+ it ( 'should have filtered text' , function ( ) {
23
+ browser . actions ( ) . mouseMove ( handle ) . perform ( ) ;
24
+ expect ( tooltip . getText ( ) ) . toBe ( 'Current value: 0%' ) ;
25
+ } ) ;
12
26
13
27
14
- // describe('view1 ', function() {
15
- //
16
- //
17
- //
18
- // it('should render view1 when user navigates to /view1', function() {
19
- // expect( element.all (by.css('[ng-view] p ')).first().getText()).
20
- // toMatch(/partial for view 1/ );
21
- // });
22
- //
23
- //});
24
-
25
-
26
- //describe('view2', function() {
27
- //
28
- // beforeEach(function() {
29
- // browser.get('index.html#/view2');
30
- // });
31
- //
32
- //
33
- // it('should render view2 when user navigates to /view2', function() {
34
- // expect(element.all(by.css('[ng-view] p')).first().getText()).
35
- // toMatch(/partial for view 2/ );
36
- // });
37
- //
38
- //});
28
+ describe ( 'should refresh filtered text ' , function ( ) {
29
+ var suffix , relayout ;
30
+
31
+ beforeEach ( function ( ) {
32
+ suffix = element ( by . model ( 'suffix' ) ) ;
33
+ relayout = element ( by . id ( 'relayout-button ') ) ;
34
+ suffix . clear ( ) ;
35
+ } ) ;
36
+
37
+ it ( 'on relayout event' , function ( ) {
38
+ suffix . sendKeys ( 'aaa' ) ;
39
+ relayout . click ( ) ;
40
+ browser . actions ( ) . mouseMove ( handle ) . perform ( ) ;
41
+ expect ( tooltip . getText ( ) ) . toBe ( 'Current value: 0aaa' ) ;
42
+ } ) ;
43
+
44
+ it ( 'on drag start' , function ( ) {
45
+ suffix . sendKeys ( 'bbb' ) ;
46
+ handle . click ( ) ;
47
+ browser . actions ( ) . mouseMove ( handle ) . perform ( ) ;
48
+ expect ( tooltip . getText ( ) ) . toBe ( 'Current value: 0bbb' ) ;
49
+ } ) ;
50
+ } ) ;
51
+ } ) ;
52
+
39
53
} ) ;
0 commit comments