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

test/border/control_test.js   A

Complexity

Total Complexity 5
Complexity/F 1

Size

Lines of Code 33
Function Count 5

Duplication

Duplicated Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 0
wmc 5
c 1
b 0
f 0
nc 1
mnd 0
bc 5
fnc 5
dl 0
loc 33
rs 10
bpm 1
cpm 1
noi 0

1 Function

Rating   Name   Duplication   Size   Complexity  
B control_test.js ➔ describe(ꞌBorder Controlꞌ) 0 31 1
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