mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2026-09-09 18:03:21 +00:00
test: add unit tests for getFileUploadErrorKey method
- Introduced unit tests for the getFileUploadErrorKey method in the file uploading list row component. - Added tests for various error codes (500, 404, 403) and scenarios for null, undefined, and zero values to ensure correct key format retrieval. [ci:force]
This commit is contained in:
+32
@@ -107,6 +107,38 @@ describe('FileUploadingListRowComponent', () => {
|
||||
expect(cancelButton.title).toBe('ADF_FILE_UPLOAD.BUTTON.STOP_FILE');
|
||||
});
|
||||
|
||||
describe('getFileUploadErrorKey', () => {
|
||||
it('should return correct key format for error code 500', () => {
|
||||
const result = component.getFileUploadErrorKey(500);
|
||||
expect(result).toBe('FILE_UPLOAD.ERRORS.500');
|
||||
});
|
||||
|
||||
it('should return correct key format for error code 404', () => {
|
||||
const result = component.getFileUploadErrorKey(404);
|
||||
expect(result).toBe('FILE_UPLOAD.ERRORS.404');
|
||||
});
|
||||
|
||||
it('should return correct key format for error code 403', () => {
|
||||
const result = component.getFileUploadErrorKey(403);
|
||||
expect(result).toBe('FILE_UPLOAD.ERRORS.403');
|
||||
});
|
||||
|
||||
it('should return GENERIC key when errorCode is null', () => {
|
||||
const result = component.getFileUploadErrorKey(null);
|
||||
expect(result).toBe('FILE_UPLOAD.ERRORS.GENERIC');
|
||||
});
|
||||
|
||||
it('should return GENERIC key when errorCode is undefined', () => {
|
||||
const result = component.getFileUploadErrorKey(undefined);
|
||||
expect(result).toBe('FILE_UPLOAD.ERRORS.GENERIC');
|
||||
});
|
||||
|
||||
it('should return GENERIC key when errorCode is 0', () => {
|
||||
const result = component.getFileUploadErrorKey(0);
|
||||
expect(result).toBe('FILE_UPLOAD.ERRORS.GENERIC');
|
||||
});
|
||||
});
|
||||
|
||||
describe('Toggle Icon State', () => {
|
||||
describe('onToggleMouseEnter', () => {
|
||||
it('should set isToggled to true when not focused', () => {
|
||||
|
||||
Reference in New Issue
Block a user