Passed
Push — master ( 985a43...f3bccc )
by Rafael
01:36
created

control_test.js ➔ ... ➔ it(ꞌrefreshes valuesꞌ)   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
c 1
b 0
f 0
nc 1
dl 0
loc 7
rs 9.4285
nop 0
1
import { Border } from '../../../controls';
2
3
describe( 'Border Control', function() {
4
	let $target = $( '<div>' ),
5
		border = new Border( { target: $target } ),
6
		$control = border.render();
7
8
	it( 'creates html', function() {
9
		expect( !! $control.html().length ).toEqual( true );
10
	} );
11
12
	it( 'refreshes values', function() {
13
		$target.css( 'border', '' );
14
		expect(  border.getValues() ).toEqual( { top: 0, right: 0, bottom: 0, left: 0 } );
15
		$target.css( 'border', '1px solid green' );
16
		border.refreshValues();
17
		expect(  border.getValues() ).toEqual( { top: 1, right: 1, bottom: 1, left: 1 } );
18
	} );
19
20
	it( 'shows border width', function() {
21
		$target.css( 'border', '2px dashed green' );
22
		border.refreshValues();
23
		expect( border.$typeControl.find( '.border-width-control' ).css( 'display' ) ).toEqual( 'block' );
24
	} );
25
26
	it( 'hides border width', function() {
27
		$target.css( 'border', '2px dashed green' );
28
		border.refreshValues();
29
		$target.css( 'border', '' );
30
		border.refreshValues();
31
		expect( border.$typeControl.find( '.border-width-control' ).css( 'display' ) ).toEqual( 'none' );
32
	} );
33
} );
34