Passed
Push — master ( e298e7...38f0a8 )
by Rafael
01:23
created

test/device-visibility/control_test.js   A

Complexity

Total Complexity 4
Complexity/F 1

Size

Lines of Code 19
Function Count 4

Duplication

Duplicated Lines 0
Ratio 0 %

Importance

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

1 Function

Rating   Name   Duplication   Size   Complexity  
A control_test.js ➔ describe(ꞌResponsive Utilityꞌ) 0 17 1
1
import { DeviceVisibility } from '../../../controls';
2
3
describe( 'Responsive Utility', function() {
4
	let $target = $( '<div class="hidden-sm">' ),
5
		control = new DeviceVisibility( { target: $target } ),
6
		$control = control.render();
7
8
	it( 'Creates HTML', function() {
9
		expect( !! $control.html().length ).toEqual( true );
10
	} );
11
12
	it( 'Sets Default', function() {
13
		expect( $control.find( '.checkboxes input[name="tablet-visibility"]:checked' ).length ).toEqual( 1 );
14
	} );
15
	it( 'Prevents all hidden', function() {
16
		$control.find( '.checkboxes input' ).prop( 'checked', true ).change();
17
		expect( $control.find( '.checkboxes input:checked' ).length ).toEqual( 3 );
18
	} );
19
} );
20