File size: 1,529 Bytes
1e92f2d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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 { buildDIFMCartExtrasObject } from '../assemblers';

describe( 'assembler', () => {
	test( 'should convert dependencies and difm state to the extras object when difm state is empty', () => {
		const dependencies = {
			newOrExistingSiteChoice: false,
			siteTitle: 'test title',
			siteDescription: 'test tagline',
			selectedDesign: { theme: 'test theme' },
			selectedSiteCategory: 'test category',
			isLetUsChooseSelected: false,
			twitterUrl: 'test twitterUrl',
			facebookUrl: 'test facebookUrl',
			linkedinUrl: 'test linkedinUrl',
			instagramUrl: 'test instagramUrl',
			displayEmail: 'test displayEmail',
			displayPhone: 'test displayPhone',
			displayAddress: 'test displayAddress',
			selectedPageTitles: [ 'test1', 'test2' ],
		};
		const siteId = 100;
		expect( buildDIFMCartExtrasObject( dependencies, siteId, 'test-context' ) ).toEqual( {
			twitter_url: 'test twitterUrl',
			facebook_url: 'test facebookUrl',
			linkedin_url: 'test linkedinUrl',
			instagram_url: 'test instagramUrl',
			display_email: 'test displayEmail',
			display_phone: 'test displayPhone',
			display_address: 'test displayAddress',
			let_us_choose_selected: false,
			new_or_existing_site_choice: false,
			selected_design: 'test theme',
			site_category: 'test category',
			site_description: 'test tagline',
			site_title: 'test title',
			selected_page_titles: [ 'test1', 'test2' ],
			afterPurchaseUrl: '/start/site-content-collection?siteId=100',
			is_store_flow: undefined,
			search_terms: undefined,
		} );
	} );
} );