test: verify embed helpers (#11318)

* test: add test cases to `window.getEmbedNamespace`

* test: add test cases when window.name doesn't have cal-embed=

* test: add test case to `getembedTheme` returning the theme from embedStore

* test: add test to `getEmbedTheme` returning the theme from query params

* Small refactor to reduce the time taken by tests and fix missing typings for embed functions on window

* Fix weird test failure

* Fix type import error caught by api.test.test

---------

Co-authored-by: Hariom Balhara <[email protected]>
This commit is contained in:
WesleyandHariom Balhara authored and GitHub committed 2023-09-14 07:14:54 +00:00
1 parent 2591ad12df
commit dfde17111c
6 files changed
+129 -65

No files matched your search

@@ -14,9 +14,10 @@ const api = getCalApi();
test("Check that the API is available", async () => {
expect(api).toBeDefined()
const awaitedApi = await api;
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
awaitedApi('floatingButton', {
calLink: 'free',
config: {
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-expect-error We are intentionaly testing invalid value
layout: 'wrongview'
}