-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[BP] refactor(datahub): added an error message when record has no link.
backported from geonetwork/geonetwork-ui#874
- Loading branch information
Showing
20 changed files
with
177 additions
and
67 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
import { ComponentFixture, TestBed } from '@angular/core/testing' | ||
|
||
import { ErrorComponent, ErrorType } from './error.component' | ||
import { DebugElement, NO_ERRORS_SCHEMA } from '@angular/core' | ||
import { By } from '@angular/platform-browser' | ||
|
||
describe('ErrorComponent', () => { | ||
let component: ErrorComponent | ||
let fixture: ComponentFixture<ErrorComponent> | ||
let compiled: DebugElement | ||
|
||
beforeEach(async () => { | ||
await TestBed.configureTestingModule({ | ||
declarations: [ErrorComponent], | ||
schemas: [NO_ERRORS_SCHEMA], | ||
}).compileComponents() | ||
}) | ||
|
||
beforeEach(() => { | ||
fixture = TestBed.createComponent(ErrorComponent) | ||
component = fixture.componentInstance | ||
compiled = fixture.debugElement | ||
}) | ||
|
||
it('should create', () => { | ||
expect(component).toBeTruthy() | ||
}) | ||
|
||
describe('ErrorType', () => { | ||
describe('ErrorType.COULD_NOT_REACH_API', () => { | ||
beforeEach(() => { | ||
component.type = ErrorType.COULD_NOT_REACH_API | ||
fixture.detectChanges() | ||
}) | ||
|
||
it('COULD_NOT_REACH_API block is displayed.', () => { | ||
const errorBlock = compiled.query( | ||
By.css('[data-test="could-not-reach-api-error"]') | ||
) | ||
expect(errorBlock).toBeTruthy() | ||
}) | ||
}) | ||
|
||
describe('ErrorType.RECEIVED_ERROR', () => { | ||
beforeEach(() => { | ||
component.type = ErrorType.RECEIVED_ERROR | ||
fixture.detectChanges() | ||
}) | ||
|
||
it('RECEIVED_ERROR block is displayed.', () => { | ||
const errorBlock = compiled.query( | ||
By.css('[data-test="received-error-error"]') | ||
) | ||
expect(errorBlock).toBeTruthy() | ||
}) | ||
}) | ||
|
||
describe('ErrorType.RECORD_NOT_FOUND', () => { | ||
beforeEach(() => { | ||
component.type = ErrorType.RECORD_NOT_FOUND | ||
fixture.detectChanges() | ||
}) | ||
|
||
it('RECORD_NOT_FOUND block is displayed.', () => { | ||
const errorBlock = compiled.query( | ||
By.css('[data-test="record-not-found-error"]') | ||
) | ||
expect(errorBlock).toBeTruthy() | ||
}) | ||
}) | ||
|
||
describe('ErrorType.NO_LINK', () => { | ||
beforeEach(() => { | ||
component.type = ErrorType.DATASET_HAS_NO_LINK | ||
fixture.detectChanges() | ||
}) | ||
|
||
it('NO_LINK block is displayed.', () => { | ||
const errorBlock = compiled.query( | ||
By.css('[data-test="dataset-has-no-link-error"]') | ||
) | ||
expect(errorBlock).toBeTruthy() | ||
}) | ||
}) | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 0 additions & 24 deletions
24
libs/ui/elements/src/lib/search-results-error/search-results-error.component.spec.ts
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.