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 Nov 1, 2019
1 parent 0a0990e commit 2468a91
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 0 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## Unreleased
## Fixed
- [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.6.0 - 2019 - 10 - 31
## Added
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 2468a91

Please sign in to comment.