Skip to content

Commit

Permalink
chore: Fix cypress type error
Browse files Browse the repository at this point in the history
  • Loading branch information
tjtanjin committed Oct 6, 2024
1 parent bbb9269 commit 99c7467
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 7 deletions.
14 changes: 7 additions & 7 deletions cypress/e2e/tests.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -194,15 +194,15 @@ describe("Chat Bot Test Suite", () => {
const themeId = "new-theme";
const themeVersion = "1.0.0";
const defaultExpiration = 3;
const themeSettings = { key: "value" };
const inlineStyles = { styleKey: "styleValue" };
const settings = {};
const inlineStyles = {};
const cssStylesText = "body { background-color: red; }";

it("Should retrieve the theme if not expired", () => {
cy.chatbotify.setCachedTheme(
themeId,
themeVersion,
themeSettings,
settings,
inlineStyles,
cssStylesText
);
Expand All @@ -214,16 +214,16 @@ describe("Chat Bot Test Suite", () => {
);

expect(theme).to.exist;
expect(theme.settings).to.deep.equal(themeSettings);
expect(theme.inlineStyles).to.deep.equal(inlineStyles);
expect(theme.cssStylesText).to.equal(cssStylesText);
expect(theme?.settings).to.deep.equal(settings);
expect(theme?.inlineStyles).to.deep.equal(inlineStyles);
expect(theme?.cssStylesText).to.equal(cssStylesText);
});

it("Should not retrieve the theme if expired", () => {
cy.chatbotify.setCachedTheme(
themeId,
themeVersion,
themeSettings,
settings,
inlineStyles,
cssStylesText
);
Expand Down
8 changes: 8 additions & 0 deletions cypress/support/index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
declare namespace Cypress {
interface Chainable {
chatbotify: {
getCachedTheme: typeof import("../../src/services/ThemeService").getCachedTheme;
setCachedTheme: typeof import("../../src/services/ThemeService").setCachedTheme;
};
}
}

0 comments on commit 99c7467

Please sign in to comment.