@@ -16,10 +16,7 @@ import {
16
16
const routerMock = {
17
17
__esModule : true ,
18
18
useRouter : ( ) => {
19
- return {
20
- query : { platform : 'react' } ,
21
- asPath : '/'
22
- } ;
19
+ return { query : { platform : 'react' } , asPath : '/' } ;
23
20
}
24
21
} ;
25
22
@@ -32,82 +29,55 @@ describe('GetStartedPopover', () => {
32
29
const getStartedLinks = [
33
30
{
34
31
title : 'React' ,
35
- href : {
36
- pathname : getStartedHref ,
37
- query : { platform : 'react' }
38
- } ,
32
+ href : { pathname : getStartedHref , query : { platform : 'react' } } ,
39
33
icon : < IconReact /> ,
40
34
platform : 'react'
41
35
} ,
42
36
{
43
37
title : 'JavaScript' ,
44
- href : {
45
- pathname : getStartedHref ,
46
- query : { platform : 'javascript' }
47
- } ,
38
+ href : { pathname : getStartedHref , query : { platform : 'javascript' } } ,
48
39
icon : < IconJS /> ,
49
40
platform : 'javascript'
50
41
} ,
51
42
{
52
43
title : 'Flutter' ,
53
- href : {
54
- pathname : getStartedHref ,
55
- query : { platform : 'flutter' }
56
- } ,
44
+ href : { pathname : getStartedHref , query : { platform : 'flutter' } } ,
57
45
icon : < IconFlutter /> ,
58
46
platform : 'flutter'
59
47
} ,
60
48
{
61
49
title : 'Swift' ,
62
- href : {
63
- pathname : getStartedHref ,
64
- query : { platform : 'swift' }
65
- } ,
50
+ href : { pathname : getStartedHref , query : { platform : 'swift' } } ,
66
51
icon : < IconSwift /> ,
67
52
platform : 'swift'
68
53
} ,
69
54
{
70
55
title : 'Android' ,
71
- href : {
72
- pathname : getStartedHref ,
73
- query : { platform : 'android' }
74
- } ,
56
+ href : { pathname : getStartedHref , query : { platform : 'android' } } ,
75
57
icon : < IconAndroid /> ,
76
58
platform : 'android'
77
59
} ,
78
60
{
79
61
title : 'React Native' ,
80
- href : {
81
- pathname : getStartedHref ,
82
- query : { platform : 'react-native' }
83
- } ,
62
+ href : { pathname : getStartedHref , query : { platform : 'react-native' } } ,
84
63
icon : < IconReact /> ,
85
64
platform : 'react-native'
86
65
} ,
87
66
{
88
67
title : 'Angular' ,
89
- href : {
90
- pathname : getStartedHref ,
91
- query : { platform : 'angular' }
92
- } ,
68
+ href : { pathname : getStartedHref , query : { platform : 'angular' } } ,
93
69
icon : < IconAngular /> ,
94
70
platform : 'angular'
95
71
} ,
96
72
{
97
73
title : 'Next.js' ,
98
- href : {
99
- pathname : getStartedHref ,
100
- query : { platform : 'nextjs' }
101
- } ,
74
+ href : { pathname : getStartedHref , query : { platform : 'nextjs' } } ,
102
75
icon : < IconNext /> ,
103
76
platform : 'nextjs'
104
77
} ,
105
78
{
106
79
title : 'Vue' ,
107
- href : {
108
- pathname : getStartedHref ,
109
- query : { platform : 'vue' }
110
- } ,
80
+ href : { pathname : getStartedHref , query : { platform : 'vue' } } ,
111
81
icon : < IconVue /> ,
112
82
platform : 'vue'
113
83
}
@@ -131,6 +101,24 @@ describe('GetStartedPopover', () => {
131
101
it ( 'should render the GetStartedPopover component' , async ( ) => {
132
102
render ( component ) ;
133
103
104
+ const gettingStartedBtn = await screen . findByRole ( 'link' , {
105
+ name : 'Build a new app'
106
+ } ) ;
107
+
108
+ expect ( gettingStartedBtn ) . toBeInTheDocument ( ) ;
109
+ } ) ;
110
+
111
+ const mobileComponent = (
112
+ < GetStartedPopover
113
+ testId = { testId }
114
+ platform = { 'swift' }
115
+ getStartedLinks = { getStartedLinks }
116
+ />
117
+ ) ;
118
+
119
+ it ( 'should render the GetStartedPopover mobile frameworks' , async ( ) => {
120
+ render ( mobileComponent ) ;
121
+
134
122
const gettingStartedBtn = await screen . findByRole ( 'link' , {
135
123
name : 'Get started'
136
124
} ) ;
@@ -142,7 +130,7 @@ describe('GetStartedPopover', () => {
142
130
render ( component ) ;
143
131
144
132
const popoverNode = await screen . findByRole ( 'link' , {
145
- name : 'Get started '
133
+ name : 'Build a new app '
146
134
} ) ;
147
135
expect ( popoverNode . getAttribute ( 'href' ) ) . toContain (
148
136
'/react/start/quickstart'
@@ -244,10 +232,7 @@ describe('GetStartedPopover', () => {
244
232
} ) ;
245
233
246
234
routerMock . useRouter = ( ) => {
247
- return {
248
- query : { platform : 'vue' } ,
249
- asPath : '/gen1'
250
- } ;
235
+ return { query : { platform : 'vue' } , asPath : '/gen1' } ;
251
236
} ;
252
237
253
238
const gen1GetStartedPopover = (
@@ -260,7 +245,7 @@ describe('GetStartedPopover', () => {
260
245
render ( gen1GetStartedPopover ) ;
261
246
262
247
const popoverNode = await screen . findByRole ( 'link' , {
263
- name : 'Get started '
248
+ name : 'Build a new app '
264
249
} ) ;
265
250
266
251
expect ( popoverNode . getAttribute ( 'href' ) ) . toContain (
0 commit comments