Skip to content

Commit

Permalink
hotfix: restore production value and fix failing test
Browse files Browse the repository at this point in the history
  • Loading branch information
casthewiz committed Sep 25, 2023
1 parent eb2320b commit b78f60d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/components/ChatbotUi.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ const ChatbotUi = ({ template }) => {
const { snootyEnv } = useSiteMetadata();

const CHATBOT_SERVER_BASE_URL =
snootyEnv === 'production' || snootyEnv === 'dotcomprd'
snootyEnv === 'dotcomprd'
? 'https://knowledge.mongodb.com/api/v1'
: 'https://knowledge.staging.corp.mongodb.com/api/v1';

Expand Down
4 changes: 4 additions & 0 deletions tests/unit/Chatbot.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@ import React from 'react';
import { render, waitFor } from '@testing-library/react';
import ComponentFactory from '../../src/components/ComponentFactory';

jest.mock('../../src/hooks/use-site-metadata', () => ({
useSiteMetadata: () => ({ reposDatabase: 'pool_test' }),
}));

describe('Chatbot Ui', () => {
it('renders the chatbot through the ComponentFactor', async () => {
const wrapper = render(<ComponentFactory nodeData={{ type: 'chatbot' }} />);
Expand Down

0 comments on commit b78f60d

Please sign in to comment.