Skip to content

Commit

Permalink
chore: sync form-dialogs feature branch (#4734)
Browse files Browse the repository at this point in the history
* Fix: form dialog view dialog action

* Fix: Prevent dismissing a property card due to click during text selection within the card

* feat: update sdk package to 4.11.0-rc2 (#4625)

* Update sdk package to 4.11.0-rc2

* Fix tests for ReplaceDialog

* Delete the default appsettings that ships with qna (#4650)

Signed-off-by: Srinaath Ravichandran <srravich@microsoft.com>

Co-authored-by: Srinaath Ravichandran <srravich@microsoft.com>

* fix: dialog resources recognizer/qna incorrect creation  (#4612)

* fix customize imported dialog resource auto creation

* add test

* avoid touch form generated dialog

* update detecting

* update test

* update detecting at server

Co-authored-by: Chris Whitten <christopher.whitten@microsoft.com>

* larger warning icon (#4665)

* fix: Test/Start buttons unable to click. (#4666)

* filter hidden card, do not render empty container

* update

Co-authored-by: Dong Lei <donglei@microsoft.com>

* fix: azure publish fail (#4660)

Co-authored-by: Dong Lei <donglei@microsoft.com>

* always show "create from scratch" button in "from url modal" (#4662)

Co-authored-by: Dong Lei <donglei@microsoft.com>

* fix: update 'Disable/Enable' buttons state in realtime (#4664)

* add dialog content as a dep of useMemo #4629

* remove log

Co-authored-by: Dong Lei <donglei@microsoft.com>

* does not allow to delete root bot (#4671)

* fix: Visual canvas mess up when add new actions in a zoom in/out mode (#4672)

* fix: mess when zoom in/out

* use scroll

Co-authored-by: Dong Lei <donglei@microsoft.com>

* use throttle 200 instead of debounce 1000 (#4670)

Co-authored-by: Dong Lei <donglei@microsoft.com>
Co-authored-by: Chris Whitten <christopher.whitten@microsoft.com>

* promisify the 'saveData()' api and fix #4616 (#4667)

Co-authored-by: Chris Whitten <christopher.whitten@microsoft.com>

* fix: Form dialog hidden fixed feature flags (#4675)

* Form dialog hidden fixed feature flags

* remove temp lint directive

* Removed debugging vars

* don't install package during eject js runtime, install and build when publish (#4668)

Co-authored-by: Dong Lei <donglei@microsoft.com>
Co-authored-by: Lu Han <32191031+luhan2017@users.noreply.github.com>

* fix: misordered using directives in runtime (#4684)

* Update Startup.cs

* Update runtime/dotnet/azurewebapp/Startup.cs

* add region parameter to luis build call options (#4685)

* change Microsoft.UpdateActivity title from "Send an activity" to "Update an activity" (#4686)

Co-authored-by: Dong Lei <donglei@microsoft.com>

* read recognizer intent from dialog content (#4683)

Co-authored-by: Dong Lei <donglei@microsoft.com>

* fix: router cache bug (#4687)

* clean all router cache when switching project

* reset routerCache

* should check rootProjectId

Co-authored-by: Dong Lei <donglei@microsoft.com>

* Fix variable name (#4661)

Co-authored-by: Dong Lei <donglei@microsoft.com>

* feature: Supporting core+package templates stored on NuGet (#4588)

* - added hosted template to template list
- updated template type to account for hosted templates

* initial scaffolding of hosted template grab

* external nuget template working e2e as template in creation flow

* Removing redundent types

* adding support for relative runtime paths.
Removing unused dependencies.

* adding comments  and removing autogenerated yan lock file from root dir

* Adding version to template acquasition
Generating build files
Fixing broken unit test

* updating template version to latest stable

* hiding remote template feature flag until NuGet packages are public

* Making PR changes

* simplifying featureflag logic
changing feature flag default values

* removing bad null check

* update naming

* Fixing broken test
updating locale files with latest added strings

* Removing 'del' dependency in favor of rimraf for directory deletions

* Reverting feature flag bug fix in favor for bug fix implemented in seperate PR

Co-authored-by: Patrick Volum <pavolum@microsoft.com>
Co-authored-by: Chris Whitten <christopher.whitten@microsoft.com>

* fix: breadcrumb display for ProjectTree (#4604)

* 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

* initialize onboarding status to complete in non-production

* restore WelcomeModalCloseIcon to ToDoBot test

Co-authored-by: Chris Whitten <christopher.whitten@microsoft.com>

* fix: Sorting OneOfField options / better default type (#4673)

* Sorting OneOfField options based on type weights

* Fix test

* fix test

Co-authored-by: Geoff Cox (Microsoft) <gcox@microsoft.com>

* Updated locale from building (#4694)

* when changes on common.lg, reparse all lgFiles (#4669)

Co-authored-by: Dong Lei <donglei@microsoft.com>
Co-authored-by: Chris Whitten <christopher.whitten@microsoft.com>

* Update projectTemplates.ts (#4697)

* fix: undo/redo (#4688)

* Bot proj breadcrumbs (#4)

* 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>

* fix: undo/redo

* add location check and add fix unit tests

* Revert "Bot proj breadcrumbs (#4)"

This reverts commit d558846.

* add selector for undo

* move status

* fix unit test

Co-authored-by: Ben Yackley <61990921+beyackle@users.noreply.github.com>
Co-authored-by: Chris Whitten <christopher.whitten@microsoft.com>
Co-authored-by: Dong Lei <donglei@microsoft.com>

* fix: Notification deep link (#4700)

* notification with multi-bot, fix url

* clean up

* redirect to dialog root (#4698)

Co-authored-by: Dong Lei <donglei@microsoft.com>

* fix: Update disabled property to booleanExpression across all the kinds + two uischema update (#4682)

* Update disabled property to booleanExpression across all the kinds

* Update server sdk schema and include other two uischema update

* Revert "Update server sdk schema and include other two uischema update"

This reverts commit cfffa74.

* update server sdk schema and include two other uischema update

Co-authored-by: Dong Lei <donglei@microsoft.com>

* fix: the generated recognizer files is messy when the dialog name has the same prefix (#4708)

* move luBuildResolver to shared lib, apply in azurePublish (#4709)

Co-authored-by: Dong Lei <donglei@microsoft.com>

* replace deprecated azure blob interface (#4702)

Co-authored-by: Dong Lei <donglei@microsoft.com>

* add useMemo to improve performance (#4701)

Co-authored-by: Dong Lei <donglei@microsoft.com>

* make name text field disable in edit (#4699)

Co-authored-by: Dong Lei <donglei@microsoft.com>

* ci: Disable CI validation (#4646)

Co-authored-by: Andy Brown <asbrown002@gmail.com>

* fix: remodel ProjectTree for greater clarity (#4714)

* start tree CSS experiments

* Update projectTemplates.ts

* make ProjectTree save tree state

* start possible fix for textwidth

* Update ProjectTree.tsx

* Update ProjectTree.tsx

* no more squishy triangles

* make left-right split view thing work

* Update treeItem.tsx

* Always enable allowClarmsValidator (#4717)

Co-authored-by: Dong Lei <donglei@microsoft.com>

* fix: undo/redo can't navigate to the correct position (#4722)

* fix: undo/redo can't navigate to the correct position

* update the type

* fix: add skillConfiguration settings for old bot (#4724)

* fix: add skillConfiguration settings for old bot

* add update file for get

Co-authored-by: Dong Lei <donglei@microsoft.com>

* fix onResize handler props (#4720)

Co-authored-by: Dong Lei <donglei@microsoft.com>

* fix: azure publish failed (#4725)

* fix: update incompatible Trigger redirect url & icon size (#4719)

* fix onResize handler props

* increase warning icon font size to 12

* fix incompatible trigger redirect url

* Revert "fix onResize handler props"

This reverts commit c9ba885.

Co-authored-by: Dong Lei <donglei@microsoft.com>

* feat: Integrate OneAuth library (#4677)

* Integrated OneAuth library for Windows

* Auth updates

* chore: remove orchestrator (#4602)

* Added CSRF protection to getAccessToken route.

* Build changes to support OneAuth

* Shared types and did some renaming.

* Consolidated types

* Fixed naming issue on babel localization config

* Separated out auth service code.

* Removed TODO

* Updated shim to be at the oneauth service level

* Added interactive retry when failing to get token silently

* Added documentation for using OneAuth locally

* sign mac assets with correct entitlements

add mac signing script

add signing and verifying steps

fix path to bundles

copy provision profile into each app bundle

copy the provision profile in contents directory

sign each dylib and framework version

fix logging string

sign frameworks before bundles

* Made temporary mac auth flow dev-env-only

* Fixed bad import

* Removed manual oneauth installation steps from AUTH.md

* Linting fixes

* Setup tests

* Added more tests

* Added test for token caching.

* Added cross-platform testing for oneauth service

Co-authored-by: Andy Brown <asbrown002@gmail.com>
Co-authored-by: Chris Whitten <christopher.whitten@microsoft.com>

Co-authored-by: Soroush <sorgh@microsoft.com>
Co-authored-by: Lu Han <32191031+luhan2017@users.noreply.github.com>
Co-authored-by: Srinaath Ravichandran <srinaath27@gmail.com>
Co-authored-by: Srinaath Ravichandran <srravich@microsoft.com>
Co-authored-by: Zhixiang Zhan <zhixzhan@microsoft.com>
Co-authored-by: Chris Whitten <christopher.whitten@microsoft.com>
Co-authored-by: zeye <zeye@microsoft.com>
Co-authored-by: Dong Lei <donglei@microsoft.com>
Co-authored-by: leileizhang <leilzh@microsoft.com>
Co-authored-by: liweitian <liweitian93@outlook.com>
Co-authored-by: Long Alan <julong@microsoft.com>
Co-authored-by: Geoff Cox (Microsoft) <gcox@microsoft.com>
Co-authored-by: VanyLaw <wenyluo@microsoft.com>
Co-authored-by: zxyanliu <32497439+zxyanliu@users.noreply.github.com>
Co-authored-by: Fei Chen <43032123+feich-ms@users.noreply.github.com>
Co-authored-by: liweitian <weitli@microsoft.com>
Co-authored-by: Péter Bozsó <3806723+peterbozso@users.noreply.github.com>
Co-authored-by: pavolum <pavolum@outlook.com>
Co-authored-by: Patrick Volum <pavolum@microsoft.com>
Co-authored-by: Ben Yackley <61990921+beyackle@users.noreply.github.com>
Co-authored-by: LouisEugeneMSFT <66701106+LouisEugeneMSFT@users.noreply.github.com>
Co-authored-by: Qi Kang <kangqidev@gmail.com>
Co-authored-by: Tony Anziano <tonyanziano5@gmail.com>
Co-authored-by: Andy Brown <asbrown002@gmail.com>
  • Loading branch information
1 parent 332f06e commit f168890
Show file tree
Hide file tree
Showing 178 changed files with 8,268 additions and 4,877 deletions.
3 changes: 2 additions & 1 deletion .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,8 @@
"args": ["${workspaceRoot}/Composer/packages/electron-server"],
"env": {
"NODE_ENV": "development",
"DEBUG": "composer*"
"DEBUG": "composer*",
"COMPOSER_ENABLE_ONEAUTH": "false"
},
"outputCapture": "std"
},
Expand Down
13 changes: 13 additions & 0 deletions Composer/babel.l10n.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.

module.exports = {
presets: ['@babel/react', ['@babel/typescript', { allowNamespaces: true }]],
plugins: ['@babel/plugin-proposal-class-properties'],
ignore: [
'packages/electron-server',
'packages/**/__tests__',
'packages/**/node_modules',
'packages/**/build/**/*.js',
],
};
4 changes: 2 additions & 2 deletions Composer/cypress/integration/Breadcrumb.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,12 @@ context('breadcrumb', () => {
hasBreadcrumbItems(cy, ['__TestTodoSample']);
});

it('can show event name in breadcrumb', () => {
it('can show dialog and trigger name in breadcrumb', () => {
cy.findByTestId('ProjectTree').within(() => {
cy.findByTestId('addtodo_Dialog started').click();
});

hasBreadcrumbItems(cy, ['__TestTodoSample', 'Dialog started']);
hasBreadcrumbItems(cy, ['addtodo', 'Dialog started']);
});

it('can show action name in breadcrumb', () => {
Expand Down
2 changes: 2 additions & 0 deletions Composer/cypress/integration/ToDoBot.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ context('ToDo Bot', () => {
before(() => {
cy.visit('/home');
cy.createBot('TodoSample');
cy.findByTestId('WelcomeModalCloseIcon').click();
cy.findByText('Yes').click();
});

it('can open the main dialog', () => {
Expand Down
2 changes: 1 addition & 1 deletion Composer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
"l10n:extract": "cross-env NODE_ENV=production format-message extract -g underscored_crc32 -o packages/server/src/locales/en-US.json l10ntemp/**/*.js",
"l10n:extractJson": "node scripts/l10n-extractJson.js",
"l10n:transform": "node scripts/l10n-transform.js",
"l10n:babel": "babel ./packages --extensions \".ts,.tsx,.jsx,.js\" --out-dir l10ntemp --presets=@babel/react,@babel/typescript --plugins=@babel/plugin-proposal-class-properties --ignore \"packages/electron-server\",\"packages/**/__tests__\",\"packages/**/node_modules\",\"packages/**/build/**/*.js\"",
"l10n:babel": "babel --config-file ./babel.l10n.config.js --extensions \"ts,.tsx,.jsx,.js\" --out-dir l10ntemp ./packages",
"l10n": "yarn l10n:babel && yarn l10n:extract && yarn l10n:transform packages/server/src/locales/en-US.json && yarn l10n:extractJson packages/server/schemas"
},
"husky": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const fnPromise = () => Promise.resolve({} as any);
export const ShellApiStub: ShellApi = {
getDialog: fn,
saveDialog: fn,
saveData: fn,
saveData: fnPromise,
navTo: fn,
onFocusSteps: fn,
onFocusEvent: fn,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ export const useEditorEventApi = (
onFocusSteps,
onFocusEvent,
onCopy: onClipboardChange,
navTo: onOpen,
navTo,
saveData: onChange,
undo,
redo,
Expand Down Expand Up @@ -153,36 +153,38 @@ export const useEditorEventApi = (
break;
case NodeEventTypes.OpenDialog:
handler = ({ callee }) => {
onOpen(callee);
navTo(callee, '"beginDialog"');
announce(ScreenReaderMessage.DialogOpened);
};
break;
case NodeEventTypes.Delete:
trackActionChange(eventData.id);
handler = (e) => {
onChange(deleteSelectedAction(path, data, e.id));
onFocusSteps([]);
announce(ScreenReaderMessage.ActionDeleted);
onChange(deleteSelectedAction(path, data, e.id), undefined, async () => {
await onFocusSteps([]);
announce(ScreenReaderMessage.ActionDeleted);
});
};
break;
case NodeEventTypes.Insert:
trackActionChange(eventData.id);
if (eventData.$kind === MenuEventTypes.Paste) {
handler = (e) => {
insertActions(path, data, e.id, e.position, clipboardActions).then((dialog) => {
onChange(dialog);
onFocusSteps([`${e.id}[${e.position || 0}]`]);
return onChange(dialog, undefined, async () => {
await onFocusSteps([`${e.id}[${e.position || 0}]`]);
announce(ScreenReaderMessage.ActionCreated);
});
});

announce(ScreenReaderMessage.ActionCreated);
};
} else {
handler = (e) => {
const newAction = dialogFactory.create(e.$kind);
insertAction(path, data, e.id, e.position, newAction).then((dialog) => {
onChange(dialog);
onFocusSteps([`${e.id}[${e.position || 0}]`]);
announce(ScreenReaderMessage.ActionCreated);
return onChange(dialog, undefined, async () => {
await onFocusSteps([`${e.id}[${e.position || 0}]`]);
announce(ScreenReaderMessage.ActionCreated);
});
});
};
}
Expand All @@ -199,9 +201,10 @@ export const useEditorEventApi = (
const actionIds = getClipboardTargetsFromContext();
trackActionListChange(actionIds);
cutSelectedActions(path, data, actionIds).then(({ dialog, cutActions }) => {
onChange(dialog);
onFocusSteps([]);
onClipboardChange(cutActions);
onChange(dialog, undefined, async () => {
await onFocusSteps([]);
onClipboardChange(cutActions);
});
});
announce(ScreenReaderMessage.ActionsCut);
};
Expand Down Expand Up @@ -259,18 +262,20 @@ export const useEditorEventApi = (
placeholderPosition.arrayIndex,
placeholderAction
);
onChange(insertResult);
onFocusSteps([]);
announce(ScreenReaderMessage.ActionsMoved);
onChange(insertResult, undefined, async () => {
await onFocusSteps([]);
announce(ScreenReaderMessage.ActionsMoved);
});
};
break;
case NodeEventTypes.DeleteSelection:
handler = () => {
const actionIds = getClipboardTargetsFromContext();
trackActionListChange(actionIds);
onChange(deleteSelectedActions(path, data, actionIds));
onFocusSteps([]);
announce(ScreenReaderMessage.ActionsDeleted);
onChange(deleteSelectedActions(path, data, actionIds), undefined, async () => {
await onFocusSteps([]);
announce(ScreenReaderMessage.ActionsDeleted);
});
};
break;
case NodeEventTypes.DisableSelection:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@ export interface ElementMeasurerProps {
export const ElementMeasurer: React.FC<ElementMeasurerProps> = ({ children, style, onResize }) => {
return (
<Measure
bounds
onResize={({ bounds }) => {
scroll
onResize={({ scroll }) => {
/**
* As a parent node, <Measure /> mounted before children mounted.
* Avoid flickering issue by filtering out the first onResize event.
*/
const { width, height } = bounds ?? { width: 0, height: 0 };
const { width, height } = scroll ?? { width: 0, height: 0 };
if (width === 0 && height === 0) return;
onResize(new Boundary(width, height));
}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ describe('getOptions', () => {
it('returns all of the types, sorted', () => {
const { options } = getOptions(schema, {});
expect(options).toEqual([
makeOption(schema, 'boolean'),
makeOption(schema, 'number'),
makeOption(schema, 'string'),
makeOption(schema, 'number'),
makeOption(schema, 'boolean'),
]);
});
});
Expand Down Expand Up @@ -71,13 +71,13 @@ describe('getOptions', () => {
const { options } = getOptions(schema, definitions);
const optionKeys = options.map((o) => o.key);
expect(optionKeys).toEqual([
'my awesome string',
'boolean',
'string',
'number',
'boolean',
'my awesome string',
'an enum',
'dropdown',
'another type',
'string',
'unknown',
]);
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,18 @@ function getOptionLabel(schema: JSONSchema7): string {
return type || 'unknown';
}

const typePriorityWeights = {
string: 5,
number: 4,
boolean: 3,
array: 2,
object: 1,
};

const sortOptionsByTypeWeights = ({ key: type1 }, { key: type2 }): number => {
return (typePriorityWeights[type1] || 0) > (typePriorityWeights[type2] || 0) ? -1 : 1;
};

export function getOptions(
schema: JSONSchema7,
definitions?: SchemaDefinitions
Expand All @@ -40,7 +52,7 @@ export function getOptions(
data: { schema: { ...schema, type: t }, icon: getFieldIconText(t) },
}));

options.sort(({ text: t1 }, { text: t2 }) => (t1 > t2 ? 1 : -1));
options.sort(sortOptionsByTypeWeights);

return { options, isNested };
}
Expand All @@ -64,6 +76,8 @@ export function getOptions(
})
.filter(Boolean) as IDropdownOption[];

options.sort(sortOptionsByTypeWeights);

const expression = (resolvedOneOf as JSONSchema7[]).find(({ $role }) => $role === 'expression');
const merged = merge({}, omit(schema, 'oneOf'), expression);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,10 @@ import React, { useState, useEffect } from 'react';
import { FieldProps, useShellApi, MicrosoftIDialog } from '@bfc/extension-client';
import { RegexRecognizer } from '@bfc/shared';

import { useFormData } from '../../hooks';

import { StringField } from './StringField';

function getRegexIntentPattern(formData: MicrosoftIDialog, intent: string): string {
const recognizer = formData.recognizer as RegexRecognizer;
function getRegexIntentPattern(dialogContent: MicrosoftIDialog, intent: string): string {
const recognizer = dialogContent.recognizer as RegexRecognizer;
let pattern = '';

if (!recognizer) {
Expand All @@ -28,15 +26,14 @@ function getRegexIntentPattern(formData: MicrosoftIDialog, intent: string): stri

const RegexIntentField: React.FC<FieldProps> = ({ value: intentName, ...rest }) => {
const { currentDialog, shellApi } = useShellApi();
const formData = useFormData();
const [localValue, setLocalValue] = useState(getRegexIntentPattern(formData, intentName));
const [localValue, setLocalValue] = useState(getRegexIntentPattern(currentDialog?.content, intentName));

// if the intent name changes or intent names in the regex patterns
// we need to reset the local value
useEffect(() => {
const pattern = getRegexIntentPattern(formData, intentName);
const pattern = getRegexIntentPattern(currentDialog?.content, intentName);
setLocalValue(pattern);
}, [intentName, (formData.recognizer as RegexRecognizer)?.intents.map((i) => i.intent)]);
}, [intentName, currentDialog?.content]);

const handleIntentChange = (pattern?: string) => {
setLocalValue(pattern ?? '');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,15 @@ import * as React from 'react';
import { render, fireEvent, act } from '@botframework-composer/test-utils';
import { createHistory, createMemorySource, LocationProvider } from '@reach/router';
import { RecoilRoot } from 'recoil';
import { getDefaultFeatureFlags } from '@bfc/shared';

import CreationFlow from '../../../src/components/CreationFlow/CreationFlow';
import { focusedStorageFolderState, creationFlowStatusState, dispatcherState } from '../../../src/recoilModel';
import {
focusedStorageFolderState,
creationFlowStatusState,
dispatcherState,
featureFlagsState,
} from '../../../src/recoilModel';
import { CreationFlowStatus } from '../../../src/constants';

describe('<CreationFlow/>', () => {
Expand All @@ -26,7 +32,7 @@ describe('<CreationFlow/>', () => {
saveTemplateId: jest.fn(),
});
set(creationFlowStatusState, CreationFlowStatus.NEW_FROM_TEMPLATE);

set(featureFlagsState, getDefaultFeatureFlags());
set(focusedStorageFolderState, {
name: 'Desktop',
parent: '/test-folder',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { fireEvent } from '@botframework-composer/test-utils';

import { renderWithRecoil } from '../testUtils/renderWithRecoil';
import CreateQnAFromUrlModal from '../../src/components/QnA/CreateQnAFromUrlModal';
import { showCreateQnAFromUrlDialogState, showCreateQnAFromUrlDialogWithScratchState } from '../../src/recoilModel';
import { showCreateQnAFromUrlDialogState } from '../../src/recoilModel';

describe('<CreateQnAFromUrlModal />', () => {
const onDismiss = jest.fn(() => {});
Expand All @@ -24,7 +24,6 @@ describe('<CreateQnAFromUrlModal />', () => {
/>,
({ set }) => {
set(showCreateQnAFromUrlDialogState(projectId), true);
set(showCreateQnAFromUrlDialogWithScratchState(projectId), true);
}
);

Expand Down
4 changes: 2 additions & 2 deletions Composer/packages/client/__tests__/components/home.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

import * as React from 'react';
import { fireEvent, render } from '@botframework-composer/test-utils';
import { ProjectTemplate } from '@bfc/shared';
import { BotTemplate } from '@bfc/shared';

import { RecentBotList } from '../../src/pages/home/RecentBotList';
import { ExampleList } from '../../src/pages/home/ExampleList';
Expand Down Expand Up @@ -32,7 +32,7 @@ describe('<Home/>', () => {
const templates = [
{ description: 'echo bot', id: 'EchoBot', name: 'Echo Bot' },
{ description: 'empty bot', id: 'EmptyBot', name: 'Empty Bot' },
] as ProjectTemplate[];
] as BotTemplate[];
const onClickTemplate = jest.fn((item) => item);
const { container, getByText } = render(<ExampleList examples={templates} onClick={onClickTemplate} />);
expect(container).toHaveTextContent('Echo Bot');
Expand Down
Loading

0 comments on commit f168890

Please sign in to comment.