Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: unit test cases for ChatBotContainer component #265

Merged
merged 5 commits into from
Nov 13, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 20 additions & 25 deletions __tests__/components/ChatBotContainer.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jest.mock("../../src/viteconfig", () => ({
},
}));

describe.skip("ChatBotContainer Component", () => {
describe("ChatBotContainer Component", () => {
beforeEach(() => {
(useButtonInternal as jest.Mock).mockReturnValue({
headerButtons: [<button key="header-btn">Header Button</button>],
Expand Down Expand Up @@ -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(<ChatBotContainer />);
Expand All @@ -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(<ChatBotContainer />);
Expand All @@ -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 },
},
});

Expand All @@ -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 },
},
});

Expand All @@ -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 },
},
});

Expand Down Expand Up @@ -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(<ChatBotContainer />);
Expand Down