File size: 512 Bytes
1e92f2d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
import { and } from 'calypso/layout/guided-tours/utils';

describe( 'Guided Tours utilities: and()', () => {
	test( 'returns true when all passed callbacks are truthy', () => {
		const a = () => true;
		const b = () => 1;
		const c = () => 'a string';
		expect( and( a, b, c )() ).toEqual( true );
	} );

	test( 'returns false when one or more callbacks are not truthy', () => {
		const a = () => true;
		const b = () => 0;
		const c = () => 'a string';
		expect( and( a, b, c )() ).toEqual( false );
	} );
} );