mirror of
https://github.com/Alfresco/alfresco-content-app.git
synced 2025-10-01 14:41:14 +00:00
[ACS-5645] added unit test cases
This commit is contained in:
@@ -121,6 +121,28 @@ describe('app.evaluators', () => {
|
||||
});
|
||||
});
|
||||
|
||||
describe('canShowExpand', () => {
|
||||
it('should return false when isLibraries returns true', () => {
|
||||
const context: any = {
|
||||
navigation: {
|
||||
url: '/libraries'
|
||||
}
|
||||
};
|
||||
|
||||
expect(app.canShowExpand(context)).toBe(false);
|
||||
});
|
||||
|
||||
it('should return false when isDetails returns true', () => {
|
||||
const context: any = {
|
||||
navigation: {
|
||||
url: '/details'
|
||||
}
|
||||
};
|
||||
|
||||
expect(app.canShowExpand(context)).toBe(false);
|
||||
});
|
||||
});
|
||||
|
||||
describe('hasLockedFiles', () => {
|
||||
it('should return [false] if selection not present', () => {
|
||||
const context: any = {};
|
||||
|
@@ -511,7 +511,7 @@ export const canEditAspects = (context: RuleContext): boolean =>
|
||||
repository.isMajorVersionAvailable(context, '7')
|
||||
].every(Boolean);
|
||||
|
||||
export const canNotShowExpand = (context: RuleContext): boolean => [!navigation.isLibraries(context), !navigation.isDetails(context)].every(Boolean);
|
||||
export const canShowExpand = (context: RuleContext): boolean => [!navigation.isLibraries(context), !navigation.isDetails(context)].every(Boolean);
|
||||
|
||||
/**
|
||||
* Checks if user can manage permissions for the selected node.
|
||||
|
@@ -225,6 +225,38 @@ describe('navigation.evaluators', () => {
|
||||
});
|
||||
});
|
||||
|
||||
describe('isDetails', () => {
|
||||
it('should return [true] if url ends with `/details`', () => {
|
||||
const context: any = {
|
||||
navigation: {
|
||||
url: '/path/details'
|
||||
}
|
||||
};
|
||||
|
||||
expect(app.isDetails(context)).toBe(true);
|
||||
});
|
||||
|
||||
it('should return [true] if url starts with `/details`', () => {
|
||||
const context: any = {
|
||||
navigation: {
|
||||
url: '/details/path'
|
||||
}
|
||||
};
|
||||
|
||||
expect(app.isDetails(context)).toBe(true);
|
||||
});
|
||||
|
||||
it('should return [true] if url includes with `/details`', () => {
|
||||
const context: any = {
|
||||
navigation: {
|
||||
url: '/details/path'
|
||||
}
|
||||
};
|
||||
|
||||
expect(app.isDetails(context)).toBe(true);
|
||||
});
|
||||
});
|
||||
|
||||
describe('isRecentFiles', () => {
|
||||
it('should return [true] if url starts with `/recent-files`', () => {
|
||||
const context: any = {
|
||||
|
Reference in New Issue
Block a user