From 7255c068cec9ed6649e32fe37577d378e0331e78 Mon Sep 17 00:00:00 2001 From: George Olson Date: Wed, 13 Nov 2024 06:52:30 -0800 Subject: [PATCH] Fix: unit test cases for ChatBotContainer component (#265) Co-authored-by: George Olson --- .../components/ChatBotContainer.test.tsx | 45 +++++++++---------- 1 file changed, 20 insertions(+), 25 deletions(-) diff --git a/__tests__/components/ChatBotContainer.test.tsx b/__tests__/components/ChatBotContainer.test.tsx index 1e67f47..6bd3ac4 100644 --- a/__tests__/components/ChatBotContainer.test.tsx +++ b/__tests__/components/ChatBotContainer.test.tsx @@ -30,7 +30,7 @@ jest.mock("../../src/viteconfig", () => ({ }, })); -describe.skip("ChatBotContainer Component", () => { +describe("ChatBotContainer Component", () => { beforeEach(() => { (useButtonInternal as jest.Mock).mockReturnValue({ headerButtons: [], @@ -81,13 +81,12 @@ describe.skip("ChatBotContainer Component", () => { (useSettingsContext as jest.Mock).mockReturnValue({ settings: { general: { - showHeader: true, - showFooter: true, + showHeader: true, showInputRow: true, + showFooter: true, flowStartTrigger: "ON_CHATBOT_INTERACT", - desktopEnabled: true, - mobileEnabled: true, }, + device: { desktopEnabled: true, mobileEnabled: true }, }, }); render(); @@ -105,13 +104,12 @@ describe.skip("ChatBotContainer Component", () => { (useSettingsContext as jest.Mock).mockReturnValue({ settings: { general: { - showHeader: true, - showFooter: false, + showHeader: true, showInputRow: false, + showFooter: false, flowStartTrigger: "ON_CHATBOT_INTERACT", - desktopEnabled: true, - mobileEnabled: true, }, + device: { desktopEnabled: true, mobileEnabled: true }, }, }); render(); @@ -125,13 +123,12 @@ describe.skip("ChatBotContainer Component", () => { (useSettingsContext as jest.Mock).mockReturnValue({ settings: { general: { - showHeader: false, - showFooter: false, + showHeader: false, showInputRow: true, + showFooter: false, flowStartTrigger: "ON_CHATBOT_INTERACT", - desktopEnabled: true, - mobileEnabled: true, }, + device: { desktopEnabled: true, mobileEnabled: true }, }, }); @@ -146,13 +143,12 @@ describe.skip("ChatBotContainer Component", () => { (useSettingsContext as jest.Mock).mockReturnValue({ settings: { general: { - showHeader: false, - showFooter: true, + showHeader: false, showInputRow: false, + showFooter: true, flowStartTrigger: "ON_CHATBOT_INTERACT", - desktopEnabled: true, - mobileEnabled: true, }, + device: { desktopEnabled: true, mobileEnabled: true }, }, }); @@ -173,13 +169,12 @@ describe.skip("ChatBotContainer Component", () => { (useSettingsContext as jest.Mock).mockReturnValue({ settings: { general: { - showHeader: true, - showFooter: true, + showHeader: true, showInputRow: true, + showFooter: true, flowStartTrigger: "ON_CHATBOT_INTERACT", - desktopEnabled: true, - mobileEnabled: true, }, + device: { desktopEnabled: true, mobileEnabled: true }, }, }); @@ -208,12 +203,12 @@ describe.skip("ChatBotContainer Component", () => { (useSettingsContext as jest.Mock).mockReturnValue({ settings: { general: { - showHeader: false, - showFooter: false, + showHeader: false, showInputRow: false, - embedded: false, - mobileEnabled: false, // Setting this to false + showFooter: false, + flowStartTrigger: "ON_CHATBOT_INTERACT", }, + device: { desktopEnabled: true, mobileEnabled: true }, }, }); render();