Limit the use of the same shortcut name when adding a shortcut- test file changes

Signed-off-by: AmbrishRamachandiran <ambrish.r@infosys.com>
This commit is contained in:
AmbrishRamachandiran
2023-07-28 20:34:22 +05:30
parent d2be7f6366
commit adff62590f
2 changed files with 8 additions and 2 deletions
+4 -1
View File
@@ -26,6 +26,7 @@ import {
import { AlertDisplay } from '@backstage/core-components';
import { TestApiProvider } from '@backstage/test-utils';
import { analyticsApiRef } from '@backstage/core-plugin-api';
import { shortcutsApiRef } from './api';
describe('AddShortcut', () => {
const api = new DefaultShortcutsApi(MockStorageApi.create());
@@ -78,7 +79,9 @@ describe('AddShortcut', () => {
const spy = jest.spyOn(api, 'add');
await renderInTestApp(
<TestApiProvider apis={[[analyticsApiRef, analyticsSpy]]}>
<TestApiProvider
apis={[[analyticsApiRef, analyticsSpy, shortcutsApiRef]]}
>
<AddShortcut {...props} />
</TestApiProvider>,
);
+4 -1
View File
@@ -27,6 +27,7 @@ import {
} from '@backstage/test-utils';
import { AlertDisplay } from '@backstage/core-components';
import { analyticsApiRef } from '@backstage/core-plugin-api';
import { shortcutsApiRef } from './api';
describe('EditShortcut', () => {
const shortcut: Shortcut = {
@@ -86,7 +87,9 @@ describe('EditShortcut', () => {
const spy = jest.spyOn(api, 'update');
await renderInTestApp(
<TestApiProvider apis={[[analyticsApiRef, analyticsSpy]]}>
<TestApiProvider
apis={[[analyticsApiRef, analyticsSpy, shortcutsApiRef]]}
>
<EditShortcut {...props} />
</TestApiProvider>,
);