mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2026-09-09 18:03:21 +00:00
AAE-40748 Bug fixes for translation and storage services (#11551)
* AAE-40748 Various i18n and storage bug fixes * refactor: update NoopTranslateModule to use provideHttpClient and provideHttpClientTesting Replaced HttpClientTestingModule with provideHttpClient and provideHttpClientTesting for improved dependency injection in the NoopTranslateModule. * refactor: update FileUploadErrorPipe tests to use TestBed for dependency injection Replaced direct instantiation of FileUploadErrorPipe with TestBed configuration, utilizing NoopTranslateModule for improved testing practices. * test: enhance StorageService and UserPreferencesService tests for improved initialization logic Added tests for UserPreferencesService to verify locale and pagination initialization from storage and config. Updated StorageService tests to restore original localStorage after each test for better isolation. * refactor: simplify TranslationService by removing direct StorageService dependency
This commit is contained in:
@@ -15,14 +15,19 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { NoopTranslationService } from '@alfresco/adf-core';
|
||||
import { NoopTranslateModule } from '@alfresco/adf-core';
|
||||
import { FileUploadErrorPipe } from './file-upload-error.pipe';
|
||||
import { TestBed } from '@angular/core/testing';
|
||||
|
||||
describe('FileUploadErrorPipe', () => {
|
||||
let pipe: FileUploadErrorPipe;
|
||||
|
||||
beforeEach(() => {
|
||||
pipe = new FileUploadErrorPipe(new NoopTranslationService());
|
||||
TestBed.configureTestingModule({
|
||||
imports: [NoopTranslateModule],
|
||||
providers: [FileUploadErrorPipe]
|
||||
});
|
||||
pipe = TestBed.inject(FileUploadErrorPipe);
|
||||
});
|
||||
|
||||
it('should return generic message when error code is null', () => {
|
||||
|
||||
Reference in New Issue
Block a user