mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[ADF-2265] fix user preference null value (#2948)
* fix user preference null value * fix method call test public
This commit is contained in:
committed by
Denys Vuika
parent
63a146616b
commit
6e57cd3e17
@@ -57,7 +57,7 @@ describe('UserPreferencesService', () => {
|
||||
appConfig.config = {
|
||||
pagination: {
|
||||
'size': 10,
|
||||
'supportedPageSizes': [ 5, 10, 15, 20 ]
|
||||
'supportedPageSizes': [5, 10, 15, 20]
|
||||
}
|
||||
};
|
||||
preferences = TestBed.get(UserPreferencesService);
|
||||
@@ -99,6 +99,12 @@ describe('UserPreferencesService', () => {
|
||||
expect(storage.getItem(propertyKey)).toBe('valueA');
|
||||
});
|
||||
|
||||
it('should null value return default prefix', () => {
|
||||
storage.setItem('paginationSize', null);
|
||||
const paginationSize = preferences.getPropertyKey('paginationSize');
|
||||
expect(preferences.get(paginationSize, 'default')).toBe('default');
|
||||
});
|
||||
|
||||
it('should save value with custom prefix', () => {
|
||||
preferences.setStoragePrefix('USER_A');
|
||||
preferences.set('propertyA', 'valueA');
|
||||
|
Reference in New Issue
Block a user