forked from Automattic/wp-calypso
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathget-jetpack-item-term-variants.js
43 lines (37 loc) · 1.36 KB
/
get-jetpack-item-term-variants.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
import {
PLAN_JETPACK_SECURITY_DAILY,
PLAN_JETPACK_SECURITY_DAILY_MONTHLY,
PRODUCT_JETPACK_BACKUP_DAILY,
PRODUCT_JETPACK_BACKUP_DAILY_MONTHLY,
} from '../src/constants';
import { getJetpackItemTermVariants } from '../src/get-jetpack-item-term-variants';
const securityVariants = {
yearly: PLAN_JETPACK_SECURITY_DAILY,
monthly: PLAN_JETPACK_SECURITY_DAILY_MONTHLY,
};
const backupVariants = {
yearly: PRODUCT_JETPACK_BACKUP_DAILY,
monthly: PRODUCT_JETPACK_BACKUP_DAILY_MONTHLY,
};
describe( 'getJetpackItemTermVariants', () => {
test( 'should return the term variants for a yearly plan', () => {
expect( getJetpackItemTermVariants( PLAN_JETPACK_SECURITY_DAILY ) ).toEqual(
expect.objectContaining( securityVariants )
);
} );
test( 'should return the term variants for a monthly plan', () => {
expect( getJetpackItemTermVariants( PLAN_JETPACK_SECURITY_DAILY_MONTHLY ) ).toEqual(
expect.objectContaining( securityVariants )
);
} );
test( 'should return the term variants for a yearly product', () => {
expect( getJetpackItemTermVariants( PRODUCT_JETPACK_BACKUP_DAILY ) ).toEqual(
expect.objectContaining( backupVariants )
);
} );
test( 'should return the term variants for a monthly product', () => {
expect( getJetpackItemTermVariants( PRODUCT_JETPACK_BACKUP_DAILY_MONTHLY ) ).toEqual(
expect.objectContaining( backupVariants )
);
} );
} );