Passed
Push — master ( 8515ac...a061e0 )
by Rafael
01:51 queued 27s
created

tsꞌ)   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 9

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
nc 1
dl 0
loc 9
rs 9.6666
cc 1
nop 0
1
import { Animation } from '../../../controls';
2
3
describe( 'Animation Control', function() {
4
	let $target = $( '<div data-wow-duration="1.5s" data-wow-delay="0s">' ),
5
		animationControl = new Animation( { target: $target } ),
6
		$control = animationControl.render();
7
8
	it( 'creates html', function() {
9
		expect( !! $control.html().length ).toEqual( true );
10
	} );
11
12
	it( 'adds animation classes', function() {
13
		$control.find( 'select' ).val( 'fadeOut' ).change();
14
		expect( $target.hasClass( 'wow' ) ).toEqual( true );
15
	} );
16
17
	it( 'presets sliders', function() {
18
		expect( animationControl.delayControl.$input.val() ).toEqual( '0' );
19
		expect( animationControl.durationControl.$input.val() ).toEqual( '1.5' );
20
	} );
21
22
	it( 'presets type', () => {
23
		let $target = $( '<div class="wow fadeIn">' ),
24
		animationControl = new Animation( { target: $target } ),
25
		$control = animationControl.render();
0 ignored issues
show
Unused Code introduced by
The variable $control seems to be never used. Consider removing it.
Loading history...
26
27
		expect( animationControl.$typeControl.val() ).toEqual( 'fadeIn' );
28
	} );
29
30
	it( 'works without presets', function() {
31
		let $target = $( '<div>' ),
32
			animationControl = new Animation( { target: $target } ),
33
			$control = animationControl.render();
0 ignored issues
show
Unused Code introduced by
The variable $control seems to be never used. Consider removing it.
Loading history...
34
35
		expect( animationControl.$typeControl.val() ).toEqual( '' );
36
		expect( animationControl.delayControl.$input.val() ).toEqual( '1' );
37
		expect( animationControl.durationControl.$input.val() ).toEqual( '1' );
38
	} );
39
40
} );
41