Merge pull request #2985 from atmire/w2p-114596_CreatingTemplateItemResultsInPageWhichNeverFinishesLoading

Fixed the problem that creating template item results in page which never finishes loading
This commit is contained in:
Tim Donohue
2024-04-26 17:13:05 -05:00
committed by GitHub
2 changed files with 17 additions and 2 deletions

View File

@@ -0,0 +1,15 @@
const ADD_TEMPLATE_ITEM_PAGE = '/collections/'.concat(Cypress.env('DSPACE_TEST_COLLECTION')).concat('/itemtemplate');
describe('Item Template', () => {
beforeEach(() => {
cy.visit(ADD_TEMPLATE_ITEM_PAGE);
cy.loginViaForm(Cypress.env('DSPACE_TEST_ADMIN_USER'), Cypress.env('DSPACE_TEST_ADMIN_PASSWORD'));
});
it('should load properly', () => {
cy.contains('.ds-header-row .lbl-cell', 'Field', { timeout: 10000 }).should('exist').should('be.visible');
cy.contains('.ds-header-row b', 'Value', { timeout: 10000 }).should('exist').should('be.visible');
cy.contains('.ds-header-row b', 'Lang', { timeout: 10000 }).should('exist').should('be.visible');
cy.contains('.ds-header-row b', 'Edit', { timeout: 10000 }).should('exist').should('be.visible');
});
});

View File

@@ -24,8 +24,8 @@ import {
import { import {
BehaviorSubject, BehaviorSubject,
combineLatest as observableCombineLatest, combineLatest as observableCombineLatest,
EMPTY,
Observable, Observable,
of,
Subscription, Subscription,
} from 'rxjs'; } from 'rxjs';
import { import {
@@ -188,7 +188,7 @@ export class DsoEditMetadataComponent implements OnInit, OnDestroy {
const lazyProvider$: Observable<UpdateDataService<DSpaceObject>> = lazyDataService(this.dataServiceMap, this.dsoType, this.parentInjector); const lazyProvider$: Observable<UpdateDataService<DSpaceObject>> = lazyDataService(this.dataServiceMap, this.dsoType, this.parentInjector);
return lazyProvider$; return lazyProvider$;
} else { } else {
return EMPTY; return of(this.updateDataService);
} }
} }