Skip to content

Commit 79bf2b3

Browse files
committed
Migrate to figform.com
1 parent a274129 commit 79bf2b3

File tree

7 files changed

+37
-37
lines changed

7 files changed

+37
-37
lines changed

CODE_OF_CONDUCT.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ event.
4747
## Enforcement
4848

4949
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders
50-
responsible for enforcement at support@figform.io. All complaints will be reviewed and investigated promptly and
50+
responsible for enforcement at support@figform.com. All complaints will be reviewed and investigated promptly and
5151
fairly.
5252

5353
All community leaders are obligated to respect the privacy and security of the reporter of any incident.

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Official FigForm SDK for JavaScript
22

3-
[FigForm](https://figform.io) is a full-featured form builder with Figma-like editor, analytics, integrations, and developer-friendly SDKs for React and JS.
3+
[FigForm](https://figform.com) is a full-featured form builder with Figma-like editor, analytics, integrations, and developer-friendly SDKs for React and JS.
44

55
## Installation
66

SECURITY.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ We take security seriously and actively maintain security updates for the follow
1212
## Reporting Security Vulnerabilities
1313

1414
We appreciate your help in keeping our project secure. If you discover a security vulnerability, please report it
15-
responsibly by emailing us at support[@]figform.io.
15+
responsibly by emailing us at support[@]figform.com.
1616

1717
### What to Include in Your Report
1818

src/options.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ export function resolveOptions(
3434
fallback: HTMLElement | null = null,
3535
): ResolvedFormOptions {
3636
return {
37-
baseUrl: options?.baseUrl ?? "https://figform.io",
37+
baseUrl: options?.baseUrl ?? "https://figform.com",
3838
parent: resolveParent(options, fallback),
3939
preview: options?.preview ?? false,
4040
};

tests/index.test.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ describe("index", () => {
2020
const mockParent = {} as HTMLElement;
2121

2222
mockResolveOptions.mockReturnValueOnce({
23-
baseUrl: "https://figform.io",
23+
baseUrl: "https://figform.com",
2424
parent: mockParent,
2525
});
2626

@@ -29,7 +29,7 @@ describe("index", () => {
2929
expect(mockResolveOptions).toHaveBeenCalledTimes(1);
3030
expect(mockResolveOptions).toHaveBeenCalledWith(options);
3131
expect(mockCreateScript).toHaveBeenCalledTimes(1);
32-
expect(mockCreateScript).toHaveBeenCalledWith(`https://figform.io/f/${id}`, mockParent);
32+
expect(mockCreateScript).toHaveBeenCalledWith(`https://figform.com/f/${id}`, mockParent);
3333
});
3434

3535
it("should resolve options and create script with custom baseUrl", () => {
@@ -56,7 +56,7 @@ describe("index", () => {
5656
const mockParent = {} as HTMLElement;
5757

5858
mockResolveOptions.mockReturnValueOnce({
59-
baseUrl: "https://figform.io",
59+
baseUrl: "https://figform.com",
6060
parent: mockParent,
6161
});
6262

@@ -65,7 +65,7 @@ describe("index", () => {
6565
expect(mockResolveOptions).toHaveBeenCalledTimes(1);
6666
expect(mockResolveOptions).toHaveBeenCalledWith(options);
6767
expect(mockCreateScript).toHaveBeenCalledTimes(1);
68-
expect(mockCreateScript).toHaveBeenCalledWith(`https://figform.io/f/${id}`, mockParent);
68+
expect(mockCreateScript).toHaveBeenCalledWith(`https://figform.com/f/${id}`, mockParent);
6969
});
7070
});
7171
});

tests/options.test.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ describe("options", () => {
2424
const result = resolveOptions(undefined);
2525

2626
expect(result).toEqual({
27-
baseUrl: "https://figform.io",
27+
baseUrl: "https://figform.com",
2828
parent: mockDocumentBody,
2929
preview: false,
3030
});
@@ -47,7 +47,7 @@ describe("options", () => {
4747
const result = resolveOptions({ parent: customParent });
4848

4949
expect(result).toEqual({
50-
baseUrl: "https://figform.io",
50+
baseUrl: "https://figform.com",
5151
parent: customParent,
5252
preview: false,
5353
});
@@ -57,7 +57,7 @@ describe("options", () => {
5757
const result = resolveOptions({ preview: true });
5858

5959
expect(result).toEqual({
60-
baseUrl: "https://figform.io",
60+
baseUrl: "https://figform.com",
6161
parent: mockDocumentBody,
6262
preview: true,
6363
});
@@ -71,7 +71,7 @@ describe("options", () => {
7171
const result = resolveOptions(options);
7272

7373
expect(result).toEqual({
74-
baseUrl: "https://figform.io",
74+
baseUrl: "https://figform.com",
7575
parent: customParent,
7676
preview: false,
7777
});
@@ -84,7 +84,7 @@ describe("options", () => {
8484
const result = resolveOptions(undefined, fallbackParent);
8585

8686
expect(result).toEqual({
87-
baseUrl: "https://figform.io",
87+
baseUrl: "https://figform.com",
8888
parent: fallbackParent,
8989
preview: false,
9090
});
@@ -101,7 +101,7 @@ describe("options", () => {
101101
const result = resolveOptions(options);
102102

103103
expect(result).toEqual({
104-
baseUrl: "https://figform.io",
104+
baseUrl: "https://figform.com",
105105
parent: options.parent,
106106
preview: false,
107107
});

tests/react.test.tsx

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)