Files
outline/shared/editor/embeds/Grist.test.tsx
Jonathan Harrrington 7ead17a8e0 Add support for Grist embeds. (#3914)
* Add support for Grist embeds.

* Change Grist integration to only support SaaS

* Update Regex

* Update shared/editor/embeds/index.tsx

Co-authored-by: Apoorv Mishra <apoorvmishra101092@gmail.com>

* Change Grist embed to use function based API

* Convert standard URL into embed url

* Update shared/editor/embeds/Grist.tsx

Co-authored-by: Apoorv Mishra <apoorvmishra101092@gmail.com>

* Update shared/editor/embeds/Grist.tsx

Co-authored-by: Apoorv Mishra <apoorvmishra101092@gmail.com>

* Update shared/editor/embeds/Grist.tsx

Co-authored-by: Apoorv Mishra <apoorvmishra101092@gmail.com>

* Lint and test updates

Co-authored-by: Apoorv Mishra <apoorvmishra101092@gmail.com>
Co-authored-by: Tom Moor <tom.moor@gmail.com>
2022-08-16 09:17:20 +05:30

34 lines
882 B
TypeScript

import Grist from "./Grist";
describe("Grist", () => {
const match = Grist.ENABLED[0];
test("to be enabled on share link", () => {
expect(
"https://templates.getgrist.com/doc/afterschool-program/p/2?embed=true".match(
match
)
).toBeTruthy();
expect(
"https://docs.getgrist.com/sg5V93LuAije/Untitled-document/p/22?embed=true".match(
match
)
).toBeTruthy();
expect(
"https://templates.getgrist.com/doc/afterschool-program".match(match)
).toBeTruthy();
});
test("to not be enabled elsewhere", () => {
// Self hosted not yet supported
expect(
"http://grist.my.host.com/o/docs/doc/new~5cCkr6CtMArdA62ohSy5xB/p/1?embed=true".match(
match
)
).toBe(null);
expect(
"https://my.get.grist.com/doc/afterschool-program?embed=true".match(match)
).toBe(null);
});
});