Update Current Navigation to version 1.1.5 with new features and configurable initial expansion
This commit is contained in:
@@ -3,6 +3,7 @@ import {
|
||||
selectCurrentNavigationRoot
|
||||
} from '../src/services/CurrentNavigationCore';
|
||||
import { ICurrentNavigationTerm } from '../src/services/CurrentNavigationTypes';
|
||||
import { isInitiallyExpanded } from '../src/extensions/currentNavigation/CurrentNavigationRenderer';
|
||||
|
||||
let passed: number = 0;
|
||||
function assert(name: string, condition: boolean): void {
|
||||
@@ -27,6 +28,10 @@ const terms: ICurrentNavigationTerm[] = [
|
||||
|
||||
assert('German boolean is accepted', parseBoolean('ja'));
|
||||
assert('local property is read', getLocalProperty(terms[0], 'CurrentNavigation.Root') === 'true');
|
||||
assert('expanded opens every branch', isInitiallyExpanded('expanded', false));
|
||||
assert('collapsed closes even the active branch', !isInitiallyExpanded('collapsed', true));
|
||||
assert('activePath keeps the previous active branch behavior', isInitiallyExpanded('activePath', true));
|
||||
assert('activePath keeps inactive branches closed', !isInitiallyExpanded('activePath', false));
|
||||
assert('site collection token resolves', resolveTermUrl(term({
|
||||
LocalCustomProperties: { '_Sys_Nav_SimpleLinkUrl': '~sitecollection/start' }
|
||||
}), 'https://portal/sites/a') === 'https://portal/sites/a/start');
|
||||
|
||||
Reference in New Issue
Block a user