forked from microsoft/BotFramework-Composer
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* remove old breadcrumbs and start making new ones * Update DesignPage.tsx * Update DesignPage.tsx * update unit tests to remove breadcrumb things * fix duplicate key bug in breadcrumbs * fix e2e test * detect and display action names in breadcrumb * rewrite to make typechecker happy * make new DesignPage unit tests * Update publisher.ts * Update publisher.ts * restore navigation in undo * retrieve breadcrumb from URL on location change * read double-nested $designer fields * navigate to trigger[0] on OpenDialog node events * fix typo and unit tests * Update validateDialogName.test.ts * better error-checking for invalid URLs * make special "beginDialog" trigger * Update en-US.json * Update DesignPage.tsx Co-authored-by: Ben Yackley <61990921+beyackle@users.noreply.github.com> Co-authored-by: Chris Whitten <christopher.whitten@microsoft.com>
- Loading branch information
1 parent
d5b2950
commit d558846
Showing
20 changed files
with
337 additions
and
348 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
65 changes: 65 additions & 0 deletions
65
Composer/packages/client/__tests__/pages/design/Design.test.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
// Copyright (c) Microsoft Corporation. | ||
// Licensed under the MIT License. | ||
import React from 'react'; | ||
|
||
import { renderWithRecoil } from '../../testUtils'; | ||
import { | ||
botProjectIdsState, | ||
currentProjectIdState, | ||
dialogsSelectorFamily, | ||
schemasState, | ||
projectMetaDataState, | ||
botProjectFileState, | ||
} from '../../../src/recoilModel'; | ||
import { undoFunctionState } from '../../../src/recoilModel/undo/history'; | ||
import mockProjectResponse from '../../../src/recoilModel/dispatchers/__tests__/mocks/mockProjectResponse.json'; | ||
import DesignPage from '../../../src/pages/design/DesignPage'; | ||
import { SAMPLE_DIALOG, SAMPLE_DIALOG_2 } from '../../mocks/sampleDialog'; | ||
|
||
const projectId = '12345.6789'; | ||
const skillId = '56789.1234'; | ||
const dialogId = SAMPLE_DIALOG.id; | ||
|
||
const initRecoilState = ({ set }) => { | ||
set(currentProjectIdState, projectId); | ||
set(botProjectIdsState, [projectId]); | ||
set(dialogsSelectorFamily(projectId), [SAMPLE_DIALOG]); | ||
set(schemasState(projectId), mockProjectResponse.schemas); | ||
set(projectMetaDataState(projectId), { isRootBot: true }); | ||
set(botProjectFileState(projectId), { foo: 'bar' }); | ||
set(undoFunctionState(projectId), { canUndo: () => false, canRedo: () => false }); | ||
}; | ||
|
||
const initRecoilStateMulti = ({ set }) => { | ||
set(currentProjectIdState, projectId); | ||
set(botProjectIdsState, [projectId, skillId]); | ||
set(dialogsSelectorFamily(projectId), [SAMPLE_DIALOG]); | ||
set(dialogsSelectorFamily(skillId), [SAMPLE_DIALOG, SAMPLE_DIALOG_2]); | ||
set(schemasState(projectId), mockProjectResponse.schemas); | ||
set(schemasState(skillId), mockProjectResponse.schemas); | ||
set(projectMetaDataState(projectId), { isRootBot: true }); | ||
set(botProjectFileState(projectId), { foo: 'bar' }); | ||
set(undoFunctionState(projectId), { canUndo: () => false, canRedo: () => false }); | ||
set(undoFunctionState(skillId), { canUndo: () => false, canRedo: () => false }); | ||
}; | ||
|
||
describe('publish page', () => { | ||
it('should render the design page (no skill)', () => { | ||
const { getAllByText, getByText } = renderWithRecoil( | ||
<DesignPage dialogId={dialogId} projectId={projectId} />, | ||
initRecoilState | ||
); | ||
getAllByText(SAMPLE_DIALOG.displayName); | ||
getByText('Start Bot'); | ||
}); | ||
|
||
it('should render the design page (with skill)', () => { | ||
const { getAllByText, getByText } = renderWithRecoil( | ||
<DesignPage dialogId={dialogId} projectId={projectId} skillId={skillId} />, | ||
initRecoilStateMulti | ||
); | ||
getAllByText(SAMPLE_DIALOG.displayName); | ||
getAllByText(SAMPLE_DIALOG_2.displayName); | ||
getByText('Start Bot'); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.