@@ -21,7 +21,7 @@ describe("react.tsx", () => {
2121 jest . resetAllMocks ( ) ;
2222
2323 mockResolveOptions . mockImplementation ( ( options , fallback ) => ( {
24- baseUrl : options ?. baseUrl ?? "https://figform.io " ,
24+ baseUrl : options ?. baseUrl ?? "https://figform.com " ,
2525 parent : fallback ?? document . createElement ( "div" ) ,
2626 preview : false ,
2727 } ) ) ;
@@ -85,7 +85,7 @@ describe("react.tsx", () => {
8585 it ( "should create script when script does not exist" , ( ) => {
8686 const mockParent = document . createElement ( "div" ) ;
8787 const resolvedOptions = {
88- baseUrl : "https://figform.io " ,
88+ baseUrl : "https://figform.com " ,
8989 parent : mockParent ,
9090 preview : false ,
9191 } ;
@@ -100,15 +100,15 @@ describe("react.tsx", () => {
100100 render ( < FigForm { ...props } /> ) ;
101101
102102 expect ( mockExistsScript ) . toHaveBeenCalledTimes ( 1 ) ;
103- expect ( mockExistsScript ) . toHaveBeenCalledWith ( "test-form" , `https://figform.io /f/${ props . id } ` , mockParent ) ;
103+ expect ( mockExistsScript ) . toHaveBeenCalledWith ( "test-form" , `https://figform.com /f/${ props . id } ` , mockParent ) ;
104104 expect ( mockCreateScript ) . toHaveBeenCalledTimes ( 1 ) ;
105- expect ( mockCreateScript ) . toHaveBeenCalledWith ( `https://figform.io /f/${ props . id } ` , mockParent ) ;
105+ expect ( mockCreateScript ) . toHaveBeenCalledWith ( `https://figform.com /f/${ props . id } ` , mockParent ) ;
106106 } ) ;
107107
108108 it ( "should not create script when script already exists" , ( ) => {
109109 const mockParent = document . createElement ( "div" ) ;
110110 const resolvedOptions = {
111- baseUrl : "https://figform.io " ,
111+ baseUrl : "https://figform.com " ,
112112 parent : mockParent ,
113113 preview : false ,
114114 } ;
@@ -123,14 +123,14 @@ describe("react.tsx", () => {
123123 render ( < FigForm { ...props } /> ) ;
124124
125125 expect ( mockExistsScript ) . toHaveBeenCalledTimes ( 1 ) ;
126- expect ( mockExistsScript ) . toHaveBeenCalledWith ( "existing-form" , `https://figform.io /f/${ props . id } ` , mockParent ) ;
126+ expect ( mockExistsScript ) . toHaveBeenCalledWith ( "existing-form" , `https://figform.com /f/${ props . id } ` , mockParent ) ;
127127 expect ( mockCreateScript ) . not . toHaveBeenCalled ( ) ;
128128 } ) ;
129129
130130 it ( "should create script with custom baseUrl" , ( ) => {
131131 const mockParent = document . createElement ( "div" ) ;
132132 const resolvedOptions = {
133- baseUrl : "https://custom.figform.io " ,
133+ baseUrl : "https://custom.figform.com " ,
134134 parent : mockParent ,
135135 preview : false ,
136136 } ;
@@ -140,7 +140,7 @@ describe("react.tsx", () => {
140140
141141 const props : FigFormProps = {
142142 id : "custom-form" ,
143- baseUrl : "https://custom.figform.io " ,
143+ baseUrl : "https://custom.figform.com " ,
144144 } ;
145145
146146 render ( < FigForm { ...props } /> ) ;
@@ -155,7 +155,7 @@ describe("react.tsx", () => {
155155 const mockFormId = "unmount-test" ;
156156 const mockParent = document . createElement ( "div" ) ;
157157 const resolvedOptions = {
158- baseUrl : "https://figform.io " ,
158+ baseUrl : "https://figform.com " ,
159159 parent : mockParent ,
160160 preview : false ,
161161 } ;
@@ -207,12 +207,12 @@ describe("react.tsx", () => {
207207 const mockParent1 = document . createElement ( "div" ) ;
208208 const mockParent2 = document . createElement ( "div" ) ;
209209 const resolvedOptions1 = {
210- baseUrl : "https://figform.io " ,
210+ baseUrl : "https://figform.com " ,
211211 parent : mockParent1 ,
212212 preview : false ,
213213 } ;
214214 const resolvedOptions2 = {
215- baseUrl : "https://custom.figform.io " ,
215+ baseUrl : "https://custom.figform.com " ,
216216 parent : mockParent2 ,
217217 preview : false ,
218218 } ;
@@ -231,7 +231,7 @@ describe("react.tsx", () => {
231231
232232 const props2 : FigFormProps = {
233233 id : "change-test" ,
234- baseUrl : "https://custom.figform.io " ,
234+ baseUrl : "https://custom.figform.com " ,
235235 } ;
236236
237237 rerender ( < ParentComponent formProps = { props2 } /> ) ;
@@ -244,7 +244,7 @@ describe("react.tsx", () => {
244244 it ( "should handle all FigFormOptions properties" , ( ) => {
245245 const mockParent = document . createElement ( "div" ) ;
246246 const resolvedOptions = {
247- baseUrl : "https://custom.figform.io " ,
247+ baseUrl : "https://custom.figform.com " ,
248248 parent : mockParent ,
249249 preview : false ,
250250 } ;
@@ -255,7 +255,7 @@ describe("react.tsx", () => {
255255 const customParentElement = document . createElement ( "section" ) ;
256256 const props : FigFormProps = {
257257 id : "full-options-test" ,
258- baseUrl : "https://custom.figform.io " ,
258+ baseUrl : "https://custom.figform.com " ,
259259 parent : customParentElement ,
260260 parentId : "should-be-ignored-when-parent-provided" ,
261261 } ;
@@ -280,7 +280,7 @@ describe("react.tsx", () => {
280280 it ( "should handle parentId option" , ( ) => {
281281 const mockParent = document . createElement ( "div" ) ;
282282 const resolvedOptions = {
283- baseUrl : "https://figform.io " ,
283+ baseUrl : "https://figform.com " ,
284284 parent : mockParent ,
285285 preview : false ,
286286 } ;
@@ -298,13 +298,13 @@ describe("react.tsx", () => {
298298 expect ( mockResolveOptions ) . toHaveBeenCalledTimes ( 1 ) ;
299299 expect ( mockResolveOptions ) . toHaveBeenCalledWith ( { parentId : props . parentId } , expect . any ( HTMLElement ) ) ;
300300 expect ( mockCreateScript ) . toHaveBeenCalledTimes ( 1 ) ;
301- expect ( mockCreateScript ) . toHaveBeenCalledWith ( `https://figform.io /f/${ props . id } ` , mockParent ) ;
301+ expect ( mockCreateScript ) . toHaveBeenCalledWith ( `https://figform.com /f/${ props . id } ` , mockParent ) ;
302302 } ) ;
303303
304304 it ( "should handle parent element option" , ( ) => {
305305 const customParent = document . createElement ( "div" ) ;
306306 const resolvedOptions = {
307- baseUrl : "https://figform.io " ,
307+ baseUrl : "https://figform.com " ,
308308 parent : customParent ,
309309 preview : false ,
310310 } ;
@@ -322,13 +322,13 @@ describe("react.tsx", () => {
322322 expect ( mockResolveOptions ) . toHaveBeenCalledTimes ( 1 ) ;
323323 expect ( mockResolveOptions ) . toHaveBeenCalledWith ( { parent : customParent } , expect . any ( HTMLElement ) ) ;
324324 expect ( mockCreateScript ) . toHaveBeenCalledTimes ( 1 ) ;
325- expect ( mockCreateScript ) . toHaveBeenCalledWith ( `https://figform.io /f/${ props . id } ` , customParent ) ;
325+ expect ( mockCreateScript ) . toHaveBeenCalledWith ( `https://figform.com /f/${ props . id } ` , customParent ) ;
326326 } ) ;
327327
328328 it ( "should handle preview option" , ( ) => {
329329 const mockParent = document . createElement ( "div" ) ;
330330 const resolvedOptions = {
331- baseUrl : "https://figform.io " ,
331+ baseUrl : "https://figform.com " ,
332332 parent : mockParent ,
333333 preview : true ,
334334 } ;
@@ -346,14 +346,14 @@ describe("react.tsx", () => {
346346 expect ( mockResolveOptions ) . toHaveBeenCalledTimes ( 1 ) ;
347347 expect ( mockResolveOptions ) . toHaveBeenCalledWith ( { preview : true } , expect . any ( HTMLElement ) ) ;
348348 expect ( mockCreateScript ) . toHaveBeenCalledTimes ( 1 ) ;
349- expect ( mockCreateScript ) . toHaveBeenCalledWith ( `https://figform.io /f/${ props . id } ?preview=true` , mockParent ) ;
349+ expect ( mockCreateScript ) . toHaveBeenCalledWith ( `https://figform.com /f/${ props . id } ?preview=true` , mockParent ) ;
350350 } ) ;
351351
352352 it ( "should handle changes to id prop" , ( ) => {
353353 const mockParent = document . createElement ( "div" ) ;
354354
355355 mockResolveOptions . mockReturnValue ( {
356- baseUrl : "https://figform.io " ,
356+ baseUrl : "https://figform.com " ,
357357 parent : mockParent ,
358358 preview : false ,
359359 } ) ;
@@ -363,11 +363,11 @@ describe("react.tsx", () => {
363363
364364 const { rerender } = render ( < TestComponent id = "initial-id" /> ) ;
365365
366- expect ( mockExistsScript ) . toHaveBeenCalledWith ( "initial-id" , "https://figform.io /f/initial-id" , mockParent ) ;
366+ expect ( mockExistsScript ) . toHaveBeenCalledWith ( "initial-id" , "https://figform.com /f/initial-id" , mockParent ) ;
367367
368368 rerender ( < TestComponent id = "changed-id" /> ) ;
369369
370- expect ( mockExistsScript ) . toHaveBeenCalledWith ( "changed-id" , "https://figform.io /f/changed-id" , mockParent ) ;
370+ expect ( mockExistsScript ) . toHaveBeenCalledWith ( "changed-id" , "https://figform.com /f/changed-id" , mockParent ) ;
371371 expect ( mockExistsScript ) . toHaveBeenCalledTimes ( 2 ) ;
372372 } ) ;
373373
0 commit comments