Skip to content

Commit

Permalink
add unit test
Browse files Browse the repository at this point in the history
Signed-off-by: yubonluo <yubonluo@amazon.com>
  • Loading branch information
yubonluo committed Apr 16, 2024
1 parent 74ca667 commit cd40b0e
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/plugins/workspace/public/utils.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

import {
featureMatchesConfig,
getAllFilterApps,
getSelectedFeatureQuantities,
isAppAccessibleInWorkspace,
} from './utils';
Expand Down Expand Up @@ -155,6 +156,14 @@ describe('workspace utils: getSelectedFeatureQuantities', () => {
navLinkStatus: 1,
},
] as PublicAppInfo[];

it('should filter out apps correctly', () => {
const filterApps = getAllFilterApps(defaultApplications);
expect(filterApps.length).toBe(2);
expect(filterApps[0].id).toBe('dashboards');
expect(filterApps[1].id).toBe('management');
});

it('should support * rules and include dashboards management', () => {
const { total, selected } = getSelectedFeatureQuantities(['*'], defaultApplications);
expect(total).toBe(2);
Expand Down

0 comments on commit cd40b0e

Please sign in to comment.