Skip to content

Commit

Permalink
Added an empty state for the recent bots submenu in the app menu for …
Browse files Browse the repository at this point in the history
…Windows
  • Loading branch information
tonyanziano committed Oct 28, 2019
1 parent 90fb9d9 commit 5c22667
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- [client] Bumped `react` & `react-dom` to `^16.8.6` to sync with Web Chat in PR [1939](https://github.com/microsoft/BotFramework-Emulator/pull/1939)
- [client] Fixed an issue with the `<AutoComplete />` component so that it can now accept an empty string as an input in "controlled mode" in PR [1939](https://github.com/microsoft/BotFramework-Emulator/pull/1939)
- [tools] Adjusted e2e tests for recent updates to application DOM in PR [1941](https://github.com/microsoft/BotFramework-Emulator/pull/1941)
- [client] Added an empty state for the recent bots submenu in the app menu for Windows in PR [1945](https://github.com/microsoft/BotFramework-Emulator/pull/1945)


## v4.5.2 - 2019 - 07 - 17
Expand Down
11 changes: 11 additions & 0 deletions packages/app/client/src/ui/shell/appMenu/appMenu.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,17 @@ describe('<AppMenu />', () => {
expect(dispatchSpy).toHaveBeenCalledWith(executeCommand(false, Bot.Switch, null, 'path1'));
});

it('should generate the recent bots menu when there are no recent bots', () => {
instance.props = {
...instance.props,
recentBots: [],
};
const recentBotsItems: MenuItem[] = (instance as any).getRecentBotsMenuItems();

expect(recentBotsItems).toHaveLength(1);
expect(recentBotsItems.reduce((labels, item) => [...labels, item.label], [])).toEqual(['No recent bots']);
});

it('should get an app update menu item for when an update is ready to install', () => {
instance.props = { ...instance.props, appUpdateStatus: UpdateStatus.UpdateReadyToInstall };
const updateItem: MenuItem = (instance as any).getAppUpdateMenuItem();
Expand Down
3 changes: 3 additions & 0 deletions packages/app/client/src/ui/shell/appMenu/appMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,9 @@ export class AppMenu extends React.Component<AppMenuProps, {}> {
};
bots.push(botItem);
});
if (!bots.length) {
bots.push({ label: 'No recent bots', disabled: true });
}
return bots;
}

Expand Down

0 comments on commit 5c22667

Please sign in to comment.