mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-07 01:54:15 +00:00
Merge branch 'main' into task/main/CST-15591
# Conflicts: # src/app/notifications/qa/source/quality-assurance-source.component.html
This commit is contained in:
@@ -18,6 +18,7 @@ export default defineConfig({
|
||||
|
||||
// Admin account used for administrative tests
|
||||
DSPACE_TEST_ADMIN_USER: 'dspacedemo+admin@gmail.com',
|
||||
DSPACE_TEST_ADMIN_USER_UUID: '335647b6-8a52-4ecb-a8c1-7ebabb199bda',
|
||||
DSPACE_TEST_ADMIN_PASSWORD: 'dspace',
|
||||
// Community/collection/publication used for view/edit tests
|
||||
DSPACE_TEST_COMMUNITY: '0958c910-2037-42a9-81c7-dca80e3892b4',
|
||||
@@ -33,6 +34,8 @@ export default defineConfig({
|
||||
// Account used to test basic submission process
|
||||
DSPACE_TEST_SUBMIT_USER: 'dspacedemo+submit@gmail.com',
|
||||
DSPACE_TEST_SUBMIT_USER_PASSWORD: 'dspace',
|
||||
// Administrator users group
|
||||
DSPACE_ADMINISTRATOR_GROUP: 'e59f5659-bff9-451e-b28f-439e7bd467e4'
|
||||
},
|
||||
e2e: {
|
||||
// Setup our plugins for e2e tests
|
||||
|
48
cypress/e2e/admin-add-new-modals.cy.ts
Normal file
48
cypress/e2e/admin-add-new-modals.cy.ts
Normal file
@@ -0,0 +1,48 @@
|
||||
import { testA11y } from 'cypress/support/utils';
|
||||
|
||||
describe('Admin Add New Modals', () => {
|
||||
beforeEach(() => {
|
||||
// Must login as an Admin for sidebar to appear
|
||||
cy.visit('/login');
|
||||
cy.loginViaForm(Cypress.env('DSPACE_TEST_ADMIN_USER'), Cypress.env('DSPACE_TEST_ADMIN_PASSWORD'));
|
||||
});
|
||||
|
||||
it('Add new Community modal should pass accessibility tests', () => {
|
||||
// Pin the sidebar open
|
||||
cy.get('#sidebar-collapse-toggle').click();
|
||||
|
||||
// Click on entry of menu
|
||||
cy.get('#admin-menu-section-new-title').click();
|
||||
|
||||
cy.get('a[data-test="menu.section.new_community"]').click();
|
||||
|
||||
// Analyze <ds-create-community-parent-selector> for accessibility
|
||||
testA11y('ds-create-community-parent-selector');
|
||||
});
|
||||
|
||||
it('Add new Collection modal should pass accessibility tests', () => {
|
||||
// Pin the sidebar open
|
||||
cy.get('#sidebar-collapse-toggle').click();
|
||||
|
||||
// Click on entry of menu
|
||||
cy.get('#admin-menu-section-new-title').click();
|
||||
|
||||
cy.get('a[data-test="menu.section.new_collection"]').click();
|
||||
|
||||
// Analyze <ds-create-collection-parent-selector> for accessibility
|
||||
testA11y('ds-create-collection-parent-selector');
|
||||
});
|
||||
|
||||
it('Add new Item modal should pass accessibility tests', () => {
|
||||
// Pin the sidebar open
|
||||
cy.get('#sidebar-collapse-toggle').click();
|
||||
|
||||
// Click on entry of menu
|
||||
cy.get('#admin-menu-section-new-title').click();
|
||||
|
||||
cy.get('a[data-test="menu.section.new_item"]').click();
|
||||
|
||||
// Analyze <ds-create-item-parent-selector> for accessibility
|
||||
testA11y('ds-create-item-parent-selector');
|
||||
});
|
||||
});
|
16
cypress/e2e/admin-curation-tasks.cy.ts
Normal file
16
cypress/e2e/admin-curation-tasks.cy.ts
Normal file
@@ -0,0 +1,16 @@
|
||||
import { testA11y } from 'cypress/support/utils';
|
||||
|
||||
describe('Admin Curation Tasks', () => {
|
||||
beforeEach(() => {
|
||||
// Must login as an Admin to see the page
|
||||
cy.visit('/admin/curation-tasks');
|
||||
cy.loginViaForm(Cypress.env('DSPACE_TEST_ADMIN_USER'), Cypress.env('DSPACE_TEST_ADMIN_PASSWORD'));
|
||||
});
|
||||
|
||||
it('should pass accessibility tests', () => {
|
||||
// Page must first be visible
|
||||
cy.get('ds-admin-curation-task').should('be.visible');
|
||||
// Analyze <ds-admin-curation-task> for accessibility issues
|
||||
testA11y('ds-admin-curation-task');
|
||||
});
|
||||
});
|
48
cypress/e2e/admin-edit-modals.cy.ts
Normal file
48
cypress/e2e/admin-edit-modals.cy.ts
Normal file
@@ -0,0 +1,48 @@
|
||||
import { testA11y } from 'cypress/support/utils';
|
||||
|
||||
describe('Admin Edit Modals', () => {
|
||||
beforeEach(() => {
|
||||
// Must login as an Admin for sidebar to appear
|
||||
cy.visit('/login');
|
||||
cy.loginViaForm(Cypress.env('DSPACE_TEST_ADMIN_USER'), Cypress.env('DSPACE_TEST_ADMIN_PASSWORD'));
|
||||
});
|
||||
|
||||
it('Edit Community modal should pass accessibility tests', () => {
|
||||
// Pin the sidebar open
|
||||
cy.get('#sidebar-collapse-toggle').click();
|
||||
|
||||
// Click on entry of menu
|
||||
cy.get('#admin-menu-section-edit-title').click();
|
||||
|
||||
cy.get('a[data-test="menu.section.edit_community"]').click();
|
||||
|
||||
// Analyze <ds-edit-community-selector> for accessibility
|
||||
testA11y('ds-edit-community-selector');
|
||||
});
|
||||
|
||||
it('Edit Collection modal should pass accessibility tests', () => {
|
||||
// Pin the sidebar open
|
||||
cy.get('#sidebar-collapse-toggle').click();
|
||||
|
||||
// Click on entry of menu
|
||||
cy.get('#admin-menu-section-edit-title').click();
|
||||
|
||||
cy.get('a[data-test="menu.section.edit_collection"]').click();
|
||||
|
||||
// Analyze <ds-edit-collection-selector> for accessibility
|
||||
testA11y('ds-edit-collection-selector');
|
||||
});
|
||||
|
||||
it('Edit Item modal should pass accessibility tests', () => {
|
||||
// Pin the sidebar open
|
||||
cy.get('#sidebar-collapse-toggle').click();
|
||||
|
||||
// Click on entry of menu
|
||||
cy.get('#admin-menu-section-edit-title').click();
|
||||
|
||||
cy.get('a[data-test="menu.section.edit_item"]').click();
|
||||
|
||||
// Analyze <ds-edit-item-selector> for accessibility
|
||||
testA11y('ds-edit-item-selector');
|
||||
});
|
||||
});
|
35
cypress/e2e/admin-export-modals.cy.ts
Normal file
35
cypress/e2e/admin-export-modals.cy.ts
Normal file
@@ -0,0 +1,35 @@
|
||||
import { testA11y } from 'cypress/support/utils';
|
||||
|
||||
describe('Admin Export Modals', () => {
|
||||
beforeEach(() => {
|
||||
// Must login as an Admin for sidebar to appear
|
||||
cy.visit('/login');
|
||||
cy.loginViaForm(Cypress.env('DSPACE_TEST_ADMIN_USER'), Cypress.env('DSPACE_TEST_ADMIN_PASSWORD'));
|
||||
});
|
||||
|
||||
it('Export metadata modal should pass accessibility tests', () => {
|
||||
// Pin the sidebar open
|
||||
cy.get('#sidebar-collapse-toggle').click();
|
||||
|
||||
// Click on entry of menu
|
||||
cy.get('#admin-menu-section-export-title').click();
|
||||
|
||||
cy.get('a[data-test="menu.section.export_metadata"]').click();
|
||||
|
||||
// Analyze <ds-export-metadata-selector> for accessibility
|
||||
testA11y('ds-export-metadata-selector');
|
||||
});
|
||||
|
||||
it('Export batch modal should pass accessibility tests', () => {
|
||||
// Pin the sidebar open
|
||||
cy.get('#sidebar-collapse-toggle').click();
|
||||
|
||||
// Click on entry of menu
|
||||
cy.get('#admin-menu-section-export-title').click();
|
||||
|
||||
cy.get('a[data-test="menu.section.export_batch"]').click();
|
||||
|
||||
// Analyze <ds-export-batch-selector> for accessibility
|
||||
testA11y('ds-export-batch-selector');
|
||||
});
|
||||
});
|
17
cypress/e2e/admin-notifications-publication-claim-page.cy.ts
Normal file
17
cypress/e2e/admin-notifications-publication-claim-page.cy.ts
Normal file
@@ -0,0 +1,17 @@
|
||||
import { testA11y } from 'cypress/support/utils';
|
||||
|
||||
describe('Admin Notifications Publication Claim Page', () => {
|
||||
beforeEach(() => {
|
||||
// Must login as an Admin to see the page
|
||||
cy.visit('/admin/notifications/publication-claim');
|
||||
cy.loginViaForm(Cypress.env('DSPACE_TEST_ADMIN_USER'), Cypress.env('DSPACE_TEST_ADMIN_PASSWORD'));
|
||||
});
|
||||
|
||||
it('should pass accessibility tests', () => {
|
||||
|
||||
//Page must first be visible
|
||||
cy.get('ds-admin-notifications-publication-claim-page').should('be.visible');
|
||||
// Analyze <ds-admin-notifications-publication-claim-page> for accessibility issues
|
||||
testA11y('ds-admin-notifications-publication-claim-page');
|
||||
});
|
||||
});
|
21
cypress/e2e/admin-search-page.cy.ts
Normal file
21
cypress/e2e/admin-search-page.cy.ts
Normal file
@@ -0,0 +1,21 @@
|
||||
import { testA11y } from 'cypress/support/utils';
|
||||
|
||||
describe('Admin Search Page', () => {
|
||||
beforeEach(() => {
|
||||
// Must login as an Admin to see the page
|
||||
cy.visit('/admin/search');
|
||||
cy.loginViaForm(Cypress.env('DSPACE_TEST_ADMIN_USER'), Cypress.env('DSPACE_TEST_ADMIN_PASSWORD'));
|
||||
});
|
||||
|
||||
it('should pass accessibility tests', () => {
|
||||
//Page must first be visible
|
||||
cy.get('ds-admin-search-page').should('be.visible');
|
||||
// At least one search result should be displayed
|
||||
cy.get('[data-test="list-object"]').should('be.visible');
|
||||
// Click each filter toggle to open *every* filter
|
||||
// (As we want to scan filter section for accessibility issues as well)
|
||||
cy.get('[data-test="filter-toggle"]').click({ multiple: true });
|
||||
// Analyze <ds-admin-search-page> for accessibility issues
|
||||
testA11y('ds-admin-search-page');
|
||||
});
|
||||
});
|
21
cypress/e2e/admin-workflow-page.cy.ts
Normal file
21
cypress/e2e/admin-workflow-page.cy.ts
Normal file
@@ -0,0 +1,21 @@
|
||||
import { testA11y } from 'cypress/support/utils';
|
||||
|
||||
describe('Admin Workflow Page', () => {
|
||||
beforeEach(() => {
|
||||
// Must login as an Admin to see the page
|
||||
cy.visit('/admin/workflow');
|
||||
cy.loginViaForm(Cypress.env('DSPACE_TEST_ADMIN_USER'), Cypress.env('DSPACE_TEST_ADMIN_PASSWORD'));
|
||||
});
|
||||
|
||||
it('should pass accessibility tests', () => {
|
||||
// Page must first be visible
|
||||
cy.get('ds-admin-workflow-page').should('be.visible');
|
||||
// At least one search result should be displayed
|
||||
cy.get('[data-test="list-object"]').should('be.visible');
|
||||
// Click each filter toggle to open *every* filter
|
||||
// (As we want to scan filter section for accessibility issues as well)
|
||||
cy.get('[data-test="filter-toggle"]').click({ multiple: true });
|
||||
// Analyze <ds-admin-workflow-page> for accessibility issues
|
||||
testA11y('ds-admin-workflow-page');
|
||||
});
|
||||
});
|
16
cypress/e2e/batch-import-page.cy.ts
Normal file
16
cypress/e2e/batch-import-page.cy.ts
Normal file
@@ -0,0 +1,16 @@
|
||||
import { testA11y } from 'cypress/support/utils';
|
||||
|
||||
describe('Batch Import Page', () => {
|
||||
beforeEach(() => {
|
||||
// Must login as an Admin to see processes
|
||||
cy.visit('/admin/batch-import');
|
||||
cy.loginViaForm(Cypress.env('DSPACE_TEST_ADMIN_USER'), Cypress.env('DSPACE_TEST_ADMIN_PASSWORD'));
|
||||
});
|
||||
|
||||
it('should pass accessibility tests', () => {
|
||||
// Batch import form must first be visible
|
||||
cy.get('ds-batch-import-page').should('be.visible');
|
||||
// Analyze <ds-batch-import-page> for accessibility issues
|
||||
testA11y('ds-batch-import-page');
|
||||
});
|
||||
});
|
16
cypress/e2e/bitstreams-format.cy.ts
Normal file
16
cypress/e2e/bitstreams-format.cy.ts
Normal file
@@ -0,0 +1,16 @@
|
||||
import { testA11y } from 'cypress/support/utils';
|
||||
|
||||
describe('Bitstreams Formats', () => {
|
||||
beforeEach(() => {
|
||||
// Must login as an Admin to see the page
|
||||
cy.visit('/admin/registries/bitstream-formats');
|
||||
cy.loginViaForm(Cypress.env('DSPACE_TEST_ADMIN_USER'), Cypress.env('DSPACE_TEST_ADMIN_PASSWORD'));
|
||||
});
|
||||
|
||||
it('should pass accessibility tests', () => {
|
||||
// Page must first be visible
|
||||
cy.get('ds-bitstream-formats').should('be.visible');
|
||||
// Analyze <ds-bitstream-formats> for accessibility issues
|
||||
testA11y('ds-bitstream-formats');
|
||||
});
|
||||
});
|
31
cypress/e2e/bulk-access.cy.ts
Normal file
31
cypress/e2e/bulk-access.cy.ts
Normal file
@@ -0,0 +1,31 @@
|
||||
import { testA11y } from 'cypress/support/utils';
|
||||
import { Options } from 'cypress-axe';
|
||||
|
||||
describe('Bulk Access', () => {
|
||||
beforeEach(() => {
|
||||
// Must login as an Admin to see the page
|
||||
cy.visit('/access-control/bulk-access');
|
||||
cy.loginViaForm(Cypress.env('DSPACE_TEST_ADMIN_USER'), Cypress.env('DSPACE_TEST_ADMIN_PASSWORD'));
|
||||
});
|
||||
|
||||
it('should pass accessibility tests', () => {
|
||||
// Page must first be visible
|
||||
cy.get('ds-bulk-access').should('be.visible');
|
||||
// At least one search result should be displayed
|
||||
cy.get('[data-test="list-object"]').should('be.visible');
|
||||
// Click each filter toggle to open *every* filter
|
||||
// (As we want to scan filter section for accessibility issues as well)
|
||||
cy.get('[data-test="filter-toggle"]').click({ multiple: true });
|
||||
// Analyze <ds-bulk-access> for accessibility issues
|
||||
testA11y('ds-bulk-access', {
|
||||
rules: {
|
||||
// All panels are accordians & fail "aria-required-children" and "nested-interactive".
|
||||
// Seem to require updating ng-bootstrap and https://github.com/DSpace/dspace-angular/issues/2216
|
||||
'aria-required-children': { enabled: false },
|
||||
'nested-interactive': { enabled: false },
|
||||
// Card titles fail this test currently
|
||||
'heading-order': { enabled: false },
|
||||
},
|
||||
} as Options);
|
||||
});
|
||||
});
|
16
cypress/e2e/create-eperson.cy.ts
Normal file
16
cypress/e2e/create-eperson.cy.ts
Normal file
@@ -0,0 +1,16 @@
|
||||
import { testA11y } from 'cypress/support/utils';
|
||||
|
||||
describe('Create Eperson', () => {
|
||||
beforeEach(() => {
|
||||
// Must login as an Admin to see the page
|
||||
cy.visit('/access-control/epeople/create');
|
||||
cy.loginViaForm(Cypress.env('DSPACE_TEST_ADMIN_USER'), Cypress.env('DSPACE_TEST_ADMIN_PASSWORD'));
|
||||
});
|
||||
|
||||
it('should pass accessibility tests', () => {
|
||||
// Form must first be visible
|
||||
cy.get('ds-eperson-form').should('be.visible');
|
||||
// Analyze <ds-eperson-form> for accessibility issues
|
||||
testA11y('ds-eperson-form');
|
||||
});
|
||||
});
|
16
cypress/e2e/create-group.cy.ts
Normal file
16
cypress/e2e/create-group.cy.ts
Normal file
@@ -0,0 +1,16 @@
|
||||
import { testA11y } from 'cypress/support/utils';
|
||||
|
||||
describe('Create Group', () => {
|
||||
beforeEach(() => {
|
||||
// Must login as an Admin to see the page
|
||||
cy.visit('/access-control/groups/create');
|
||||
cy.loginViaForm(Cypress.env('DSPACE_TEST_ADMIN_USER'), Cypress.env('DSPACE_TEST_ADMIN_PASSWORD'));
|
||||
});
|
||||
|
||||
it('should pass accessibility tests', () => {
|
||||
// Form must first be visible
|
||||
cy.get('ds-group-form').should('be.visible');
|
||||
// Analyze <ds-group-form> for accessibility issues
|
||||
testA11y('ds-group-form');
|
||||
});
|
||||
});
|
16
cypress/e2e/edit-eperson.cy.ts
Normal file
16
cypress/e2e/edit-eperson.cy.ts
Normal file
@@ -0,0 +1,16 @@
|
||||
import { testA11y } from 'cypress/support/utils';
|
||||
|
||||
describe('Edit Eperson', () => {
|
||||
beforeEach(() => {
|
||||
// Must login as an Admin to see the page
|
||||
cy.visit('/access-control/epeople/'.concat(Cypress.env('DSPACE_TEST_ADMIN_USER_UUID')).concat('/edit'));
|
||||
cy.loginViaForm(Cypress.env('DSPACE_TEST_ADMIN_USER'), Cypress.env('DSPACE_TEST_ADMIN_PASSWORD'));
|
||||
});
|
||||
|
||||
it('should pass accessibility tests', () => {
|
||||
// Form must first be visible
|
||||
cy.get('ds-eperson-form').should('be.visible');
|
||||
// Analyze <ds-eperson-form> for accessibility issues
|
||||
testA11y('ds-eperson-form');
|
||||
});
|
||||
});
|
16
cypress/e2e/edit-group.cy.ts
Normal file
16
cypress/e2e/edit-group.cy.ts
Normal file
@@ -0,0 +1,16 @@
|
||||
import { testA11y } from 'cypress/support/utils';
|
||||
|
||||
describe('Edit Group', () => {
|
||||
beforeEach(() => {
|
||||
// Must login as an Admin to see the page
|
||||
cy.visit('/access-control/groups/'.concat(Cypress.env('DSPACE_ADMINISTRATOR_GROUP')).concat('/edit'));
|
||||
cy.loginViaForm(Cypress.env('DSPACE_TEST_ADMIN_USER'), Cypress.env('DSPACE_TEST_ADMIN_PASSWORD'));
|
||||
});
|
||||
|
||||
it('should pass accessibility tests', () => {
|
||||
// Form must first be visible
|
||||
cy.get('ds-group-form').should('be.visible');
|
||||
// Analyze <ds-group-form> for accessibility issues
|
||||
testA11y('ds-group-form');
|
||||
});
|
||||
});
|
13
cypress/e2e/end-user-agreement.cy.ts
Normal file
13
cypress/e2e/end-user-agreement.cy.ts
Normal file
@@ -0,0 +1,13 @@
|
||||
import { testA11y } from 'cypress/support/utils';
|
||||
|
||||
describe('End User Agreement', () => {
|
||||
it('should pass accessibility tests', () => {
|
||||
cy.visit('/info/end-user-agreement');
|
||||
|
||||
// Page must first be visible
|
||||
cy.get('ds-end-user-agreement').should('be.visible');
|
||||
|
||||
// Analyze <ds-end-user-agreement> for accessibility
|
||||
testA11y('ds-end-user-agreement');
|
||||
});
|
||||
});
|
16
cypress/e2e/epeople-registry.cy.ts
Normal file
16
cypress/e2e/epeople-registry.cy.ts
Normal file
@@ -0,0 +1,16 @@
|
||||
import { testA11y } from 'cypress/support/utils';
|
||||
|
||||
describe('Epeople registry', () => {
|
||||
beforeEach(() => {
|
||||
// Must login as an Admin to see the page
|
||||
cy.visit('/access-control/epeople');
|
||||
cy.loginViaForm(Cypress.env('DSPACE_TEST_ADMIN_USER'), Cypress.env('DSPACE_TEST_ADMIN_PASSWORD'));
|
||||
});
|
||||
|
||||
it('should pass accessibility tests', () => {
|
||||
// Epeople registry page must first be visible
|
||||
cy.get('ds-epeople-registry').should('be.visible');
|
||||
// Analyze <ds-epeople-registry> for accessibility issues
|
||||
testA11y('ds-epeople-registry');
|
||||
});
|
||||
});
|
13
cypress/e2e/feedback.cy.ts
Normal file
13
cypress/e2e/feedback.cy.ts
Normal file
@@ -0,0 +1,13 @@
|
||||
import { testA11y } from 'cypress/support/utils';
|
||||
|
||||
describe('Feedback', () => {
|
||||
it('should pass accessibility tests', () => {
|
||||
cy.visit('/info/feedback');
|
||||
|
||||
// Page must first be visible
|
||||
cy.get('ds-feedback').should('be.visible');
|
||||
|
||||
// Analyze <ds-feedback> for accessibility
|
||||
testA11y('ds-feedback');
|
||||
});
|
||||
});
|
16
cypress/e2e/groups-registry.cy.ts
Normal file
16
cypress/e2e/groups-registry.cy.ts
Normal file
@@ -0,0 +1,16 @@
|
||||
import { testA11y } from 'cypress/support/utils';
|
||||
|
||||
describe('Groups registry', () => {
|
||||
beforeEach(() => {
|
||||
// Must login as an Admin to see the page
|
||||
cy.visit('/access-control/groups');
|
||||
cy.loginViaForm(Cypress.env('DSPACE_TEST_ADMIN_USER'), Cypress.env('DSPACE_TEST_ADMIN_PASSWORD'));
|
||||
});
|
||||
|
||||
it('should pass accessibility tests', () => {
|
||||
// Epeople registry page must first be visible
|
||||
cy.get('ds-groups-registry').should('be.visible');
|
||||
// Analyze <ds-groups-registry> for accessibility issues
|
||||
testA11y('ds-groups-registry');
|
||||
});
|
||||
});
|
62
cypress/e2e/health-page.cy.ts
Normal file
62
cypress/e2e/health-page.cy.ts
Normal file
@@ -0,0 +1,62 @@
|
||||
import { testA11y } from 'cypress/support/utils';
|
||||
import { Options } from 'cypress-axe';
|
||||
|
||||
|
||||
beforeEach(() => {
|
||||
// Must login as an Admin to see the page
|
||||
cy.visit('/health');
|
||||
cy.loginViaForm(Cypress.env('DSPACE_TEST_ADMIN_USER'), Cypress.env('DSPACE_TEST_ADMIN_PASSWORD'));
|
||||
});
|
||||
|
||||
describe('Health Page > Status Tab', () => {
|
||||
it('should pass accessibility tests', () => {
|
||||
cy.intercept('GET', '/server/actuator/health').as('status');
|
||||
cy.wait('@status');
|
||||
|
||||
cy.get('a[data-test="health-page.status-tab"]').click();
|
||||
// Page must first be visible
|
||||
cy.get('ds-health-page').should('be.visible');
|
||||
cy.get('ds-health-panel').should('be.visible');
|
||||
|
||||
// wait for all the ds-health-info-component components to be rendered
|
||||
cy.get('div[role="tabpanel"]').each(($panel: HTMLDivElement) => {
|
||||
cy.wrap($panel).find('ds-health-component').should('be.visible');
|
||||
});
|
||||
// Analyze <ds-health-page> for accessibility issues
|
||||
testA11y('ds-health-page', {
|
||||
rules: {
|
||||
// All panels are accordians & fail "aria-required-children" and "nested-interactive".
|
||||
// Seem to require updating ng-bootstrap and https://github.com/DSpace/dspace-angular/issues/2216
|
||||
'aria-required-children': { enabled: false },
|
||||
'nested-interactive': { enabled: false },
|
||||
},
|
||||
} as Options);
|
||||
});
|
||||
});
|
||||
|
||||
describe('Health Page > Info Tab', () => {
|
||||
it('should pass accessibility tests', () => {
|
||||
cy.intercept('GET', '/server/actuator/info').as('info');
|
||||
cy.wait('@info');
|
||||
|
||||
cy.get('a[data-test="health-page.info-tab"]').click();
|
||||
// Page must first be visible
|
||||
cy.get('ds-health-page').should('be.visible');
|
||||
cy.get('ds-health-info').should('be.visible');
|
||||
|
||||
// wait for all the ds-health-info-component components to be rendered
|
||||
cy.get('div[role="tabpanel"]').each(($panel: HTMLDivElement) => {
|
||||
cy.wrap($panel).find('ds-health-info-component').should('be.visible');
|
||||
});
|
||||
|
||||
// Analyze <ds-health-info> for accessibility issues
|
||||
testA11y('ds-health-info', {
|
||||
rules: {
|
||||
// All panels are accordions & fail "aria-required-children" and "nested-interactive".
|
||||
// Seem to require updating ng-bootstrap and https://github.com/DSpace/dspace-angular/issues/2216
|
||||
'aria-required-children': { enabled: false },
|
||||
'nested-interactive': { enabled: false },
|
||||
},
|
||||
} as Options);
|
||||
});
|
||||
});
|
@@ -9,6 +9,11 @@ beforeEach(() => {
|
||||
|
||||
// This page is restricted, so we will be shown the login form. Fill it out & submit.
|
||||
cy.loginViaForm(Cypress.env('DSPACE_TEST_ADMIN_USER'), Cypress.env('DSPACE_TEST_ADMIN_PASSWORD'));
|
||||
|
||||
// We need to wait for the correction types allowed for the item to be loaded to be sure that each tab is fully loaded.
|
||||
// This because the edit item page causes often tests to fails due to timeout.
|
||||
cy.intercept('GET', 'server/api/config/correctiontypes/search/findByItem*').as('correctionTypes');
|
||||
cy.wait('@correctionTypes');
|
||||
});
|
||||
|
||||
describe('Edit Item > Edit Metadata tab', () => {
|
||||
|
16
cypress/e2e/metadata-import-page.cy.ts
Normal file
16
cypress/e2e/metadata-import-page.cy.ts
Normal file
@@ -0,0 +1,16 @@
|
||||
import { testA11y } from 'cypress/support/utils';
|
||||
|
||||
describe('Metadata Import Page', () => {
|
||||
beforeEach(() => {
|
||||
// Must login as an Admin to see the page
|
||||
cy.visit('/admin/metadata-import');
|
||||
cy.loginViaForm(Cypress.env('DSPACE_TEST_ADMIN_USER'), Cypress.env('DSPACE_TEST_ADMIN_PASSWORD'));
|
||||
});
|
||||
|
||||
it('should pass accessibility tests', () => {
|
||||
// Metadata import form must first be visible
|
||||
cy.get('ds-metadata-import-page').should('be.visible');
|
||||
// Analyze <ds-metadata-import-page> for accessibility issues
|
||||
testA11y('ds-metadata-import-page');
|
||||
});
|
||||
});
|
16
cypress/e2e/metadata-registry.cy.ts
Normal file
16
cypress/e2e/metadata-registry.cy.ts
Normal file
@@ -0,0 +1,16 @@
|
||||
import { testA11y } from 'cypress/support/utils';
|
||||
|
||||
describe('Metadata Registry', () => {
|
||||
beforeEach(() => {
|
||||
// Must login as an Admin to see the page
|
||||
cy.visit('/admin/registries/metadata');
|
||||
cy.loginViaForm(Cypress.env('DSPACE_TEST_ADMIN_USER'), Cypress.env('DSPACE_TEST_ADMIN_PASSWORD'));
|
||||
});
|
||||
|
||||
it('should pass accessibility tests', () => {
|
||||
// Page must first be visible
|
||||
cy.get('ds-metadata-registry').should('be.visible');
|
||||
// Analyze <ds-metadata-registry> for accessibility issues
|
||||
testA11y('ds-metadata-registry');
|
||||
});
|
||||
});
|
16
cypress/e2e/metadata-schema.cy.ts
Normal file
16
cypress/e2e/metadata-schema.cy.ts
Normal file
@@ -0,0 +1,16 @@
|
||||
import { testA11y } from 'cypress/support/utils';
|
||||
|
||||
describe('Metadata Schema', () => {
|
||||
beforeEach(() => {
|
||||
// Must login as an Admin to see the page
|
||||
cy.visit('/admin/registries/metadata/dc');
|
||||
cy.loginViaForm(Cypress.env('DSPACE_TEST_ADMIN_USER'), Cypress.env('DSPACE_TEST_ADMIN_PASSWORD'));
|
||||
});
|
||||
|
||||
it('should pass accessibility tests', () => {
|
||||
// Page must first be visible
|
||||
cy.get('ds-metadata-schema').should('be.visible');
|
||||
// Analyze <ds-metadata-schema> for accessibility issues
|
||||
testA11y('ds-metadata-schema');
|
||||
});
|
||||
});
|
16
cypress/e2e/new-process.cy.ts
Normal file
16
cypress/e2e/new-process.cy.ts
Normal file
@@ -0,0 +1,16 @@
|
||||
import { testA11y } from 'cypress/support/utils';
|
||||
|
||||
describe('New Process', () => {
|
||||
beforeEach(() => {
|
||||
// Must login as an Admin to see the page
|
||||
cy.visit('/processes/new');
|
||||
cy.loginViaForm(Cypress.env('DSPACE_TEST_ADMIN_USER'), Cypress.env('DSPACE_TEST_ADMIN_PASSWORD'));
|
||||
});
|
||||
|
||||
it('should pass accessibility tests', () => {
|
||||
// Process form must first be visible
|
||||
cy.get('ds-new-process').should('be.visible');
|
||||
// Analyze <ds-new-process> for accessibility issues
|
||||
testA11y('ds-new-process');
|
||||
});
|
||||
});
|
13
cypress/e2e/privacy.cy.ts
Normal file
13
cypress/e2e/privacy.cy.ts
Normal file
@@ -0,0 +1,13 @@
|
||||
import { testA11y } from 'cypress/support/utils';
|
||||
|
||||
describe('Privacy', () => {
|
||||
it('should pass accessibility tests', () => {
|
||||
cy.visit('/info/privacy');
|
||||
|
||||
// Page must first be visible
|
||||
cy.get('ds-privacy').should('be.visible');
|
||||
|
||||
// Analyze <ds-privacy> for accessibility
|
||||
testA11y('ds-privacy');
|
||||
});
|
||||
});
|
17
cypress/e2e/processes-overview.cy.ts
Normal file
17
cypress/e2e/processes-overview.cy.ts
Normal file
@@ -0,0 +1,17 @@
|
||||
import { testA11y } from 'cypress/support/utils';
|
||||
|
||||
describe('Processes Overview', () => {
|
||||
beforeEach(() => {
|
||||
// Must login as an Admin to see the page
|
||||
cy.visit('/processes');
|
||||
cy.loginViaForm(Cypress.env('DSPACE_TEST_ADMIN_USER'), Cypress.env('DSPACE_TEST_ADMIN_PASSWORD'));
|
||||
});
|
||||
|
||||
it('should pass accessibility tests', () => {
|
||||
|
||||
// Process overview must first be visible
|
||||
cy.get('ds-process-overview').should('be.visible');
|
||||
// Analyze <ds-process-overview> for accessibility issues
|
||||
testA11y('ds-process-overview');
|
||||
});
|
||||
});
|
16
cypress/e2e/profile-page.cy.ts
Normal file
16
cypress/e2e/profile-page.cy.ts
Normal file
@@ -0,0 +1,16 @@
|
||||
import { testA11y } from 'cypress/support/utils';
|
||||
|
||||
describe('Profile page', () => {
|
||||
beforeEach(() => {
|
||||
// Must login as an Admin to see the page
|
||||
cy.visit('/profile');
|
||||
cy.loginViaForm(Cypress.env('DSPACE_TEST_ADMIN_USER'), Cypress.env('DSPACE_TEST_ADMIN_PASSWORD'));
|
||||
});
|
||||
|
||||
it('should pass accessibility tests', () => {
|
||||
// Process form must first be visible
|
||||
cy.get('ds-profile-page').should('be.visible');
|
||||
// Analyze <ds-profile-page> for accessibility issues
|
||||
testA11y('ds-profile-page');
|
||||
});
|
||||
});
|
16
cypress/e2e/quality-assurance-source-page.cy.ts
Normal file
16
cypress/e2e/quality-assurance-source-page.cy.ts
Normal file
@@ -0,0 +1,16 @@
|
||||
import { testA11y } from 'cypress/support/utils';
|
||||
|
||||
describe('Quality Assurance Source Page', () => {
|
||||
beforeEach(() => {
|
||||
// Must login as an Admin to see the page
|
||||
cy.visit('/notifications/quality-assurance');
|
||||
cy.loginViaForm(Cypress.env('DSPACE_TEST_ADMIN_USER'), Cypress.env('DSPACE_TEST_ADMIN_PASSWORD'));
|
||||
});
|
||||
|
||||
it('should pass accessibility tests', () => {
|
||||
// Source page must first be visible
|
||||
cy.get('ds-quality-assurance-source-page-component').should('be.visible');
|
||||
// Analyze <ds-quality-assurance-source-page-component> for accessibility issues
|
||||
testA11y('ds-quality-assurance-source-page-component');
|
||||
});
|
||||
});
|
16
cypress/e2e/system-wide-alert.cy.ts
Normal file
16
cypress/e2e/system-wide-alert.cy.ts
Normal file
@@ -0,0 +1,16 @@
|
||||
import { testA11y } from 'cypress/support/utils';
|
||||
|
||||
describe('System Wide Alert', () => {
|
||||
beforeEach(() => {
|
||||
// Must login as an Admin to see the page
|
||||
cy.visit('/admin/system-wide-alert');
|
||||
cy.loginViaForm(Cypress.env('DSPACE_TEST_ADMIN_USER'), Cypress.env('DSPACE_TEST_ADMIN_PASSWORD'));
|
||||
});
|
||||
|
||||
it('should pass accessibility tests', () => {
|
||||
// Page must first be visible
|
||||
cy.get('ds-system-wide-alert-form').should('be.visible');
|
||||
// Analyze <ds-system-wide-alert-form> for accessibility issues
|
||||
testA11y('ds-system-wide-alert-form');
|
||||
});
|
||||
});
|
@@ -1,6 +1,6 @@
|
||||
<div *ngIf="buttonVisible$ | async">
|
||||
<a href="javascript:void(0);"
|
||||
role="button"
|
||||
role="menuitem"
|
||||
(click)="onClick()"
|
||||
[attr.aria-label]="'nav.context-help-toggle' | translate"
|
||||
[title]="'nav.context-help-toggle' | translate"
|
||||
|
@@ -3,7 +3,7 @@
|
||||
<div *ngIf="(healthResponse | async) && (healthInfoResponse | async)">
|
||||
<ul ngbNav #nav="ngbNav" [activeId]="'status'" class="nav-tabs">
|
||||
<li [ngbNavItem]="'status'" role="presentation">
|
||||
<a ngbNavLink>{{'health-page.status-tab' | translate}}</a>
|
||||
<a data-test="health-page.status-tab" ngbNavLink>{{'health-page.status-tab' | translate}}</a>
|
||||
<ng-template ngbNavContent>
|
||||
<div id="status">
|
||||
<ds-health-panel [healthResponse]="(healthResponse | async)"></ds-health-panel>
|
||||
@@ -11,7 +11,7 @@
|
||||
</ng-template>
|
||||
</li>
|
||||
<li [ngbNavItem]="'info'" role="presentation">
|
||||
<a ngbNavLink>{{'health-page.info-tab' | translate}}</a>
|
||||
<a data-test="health-page.info-tab" ngbNavLink>{{'health-page.info-tab' | translate}}</a>
|
||||
<ng-template ngbNavContent>
|
||||
<div id="info">
|
||||
<ds-health-info [healthInfoResponse]="(healthInfoResponse | async)"></ds-health-info>
|
||||
|
@@ -63,7 +63,7 @@
|
||||
<p>We reserve the right, but not the obligation, to: (1) monitor the Site for violations of these Terms of Use; (2) take appropriate legal action against anyone who, in our sole discretion, violates the law or these Terms of Use, including without limitation, reporting such user to law enforcement authorities; (3) in our sole discretion and without limitation, refuse, restrict access to, limit the availability of, or disable (to the extent technologically feasible) any of your Contributions or any portion thereof; (4) in our sole discretion and without limitation, notice, or liability, to remove from the Site or otherwise disable all files and content that are excessive in size or are in any way burdensome to our systems; and (5) otherwise manage the Site in a manner designed to protect our rights and property and to facilitate the proper functioning of the Site.</p>
|
||||
|
||||
<h2>Privacy policy</h2>
|
||||
<p>We care about data privacy and security. Please review our <a [routerLink]="['/info/privacy']" target="_blank" rel="noopener noreferrer">Privacy Policy</a>. By using the Site, you agree to be bound by our Privacy Policy, which is incorporated into these Terms of Use.</p>
|
||||
<p>We care about data privacy and security. Please review our <a class="link-contrast" [routerLink]="['/info/privacy']" target="_blank" rel="noopener noreferrer">Privacy Policy</a>. By using the Site, you agree to be bound by our Privacy Policy, which is incorporated into these Terms of Use.</p>
|
||||
<p>Please be advised the Site is hosted in {{ 'info.end-user-agreement.hosting-country' | translate }}. If you access the Site from any other region of the world with laws or other requirements governing personal data collection, use, or disclosure that differ from applicable laws in {{ 'info.end-user-agreement.hosting-country' | translate }}, then through your continued use of the Site, you are transferring your data to {{ 'info.end-user-agreement.hosting-country' | translate }}, and you agree to have your data transferred to and processed in {{ 'info.end-user-agreement.hosting-country' | translate }}.</p>
|
||||
|
||||
<h2>Term and termination</h2>
|
||||
@@ -92,4 +92,4 @@
|
||||
<h2>Miscellaneous</h2>
|
||||
<p>These Terms of Use and any policies or operating rules posted by us on the Site or in respect to the Site constitute the entire agreement and understanding between you and us. Our failure to exercise or enforce any right or provision of these Terms of Use shall not operate as a waiver of such right or provision. These Terms of Use operate to the fullest extent permissible by law. We may assign any or all of our rights and obligations to others at any time. We shall not be responsible or liable for any loss, damage, delay, or failure to act caused by any cause beyond our reasonable control. If any provision or part of a provision of these Terms of Use is determined to be unlawful, void, or unenforceable, that provision or part of the provision is deemed severable from these Terms of Use and does not affect the validity and enforceability of any remaining provisions. There is no joint venture, partnership, employment or agency relationship created between you and us as a result of these Terms of Use or use of the Site. You agree that these Terms of Use will not be construed against us by virtue of having drafted them. You hereby waive any and all defenses you may have based on the electronic form of these Terms of Use and the lack of signing by the parties hereto to execute these Terms of Use.</p>
|
||||
|
||||
<p><a [routerLink]="'.'" fragment="ref-a" id="comment-a">[a]</a> The DSpace software used to run this site is open source. Options for reuse and reproduction of the DSpace software is governed by its open source license: <a href="https://github.com/DSpace/DSpace/blob/main/LICENSE" target="_blank" rel="noopener noreferrer">https://github.com/DSpace/DSpace/blob/main/LICENSE</a></p>
|
||||
<p><a class="link-contrast" [routerLink]="'.'" fragment="ref-a" id="comment-a">[a]</a> The DSpace software used to run this site is open source. Options for reuse and reproduction of the DSpace software is governed by its open source license: <a class="link-contrast" href="https://github.com/DSpace/DSpace/blob/main/LICENSE" target="_blank" rel="noopener noreferrer">https://github.com/DSpace/DSpace/blob/main/LICENSE</a></p>
|
||||
|
@@ -83,9 +83,9 @@
|
||||
<p>We may also disclose your personal information:</p>
|
||||
<ul>
|
||||
<li>To comply with any court order, law, or legal process, including to respond to any government or regulatory request.</li>
|
||||
<li>To enforce or apply our <a [routerLink]="['/info/end-user-agreement']" target="_blank" rel="noopener noreferrer">End User Agreement</a> and other agreements, including for billing and collection purposes.</li>
|
||||
<li>To enforce or apply our <a class="link-contrast" [routerLink]="['/info/end-user-agreement']" target="_blank" rel="noopener noreferrer">End User Agreement</a> and other agreements, including for billing and collection purposes.</li>
|
||||
<li>If we believe disclosure is necessary or appropriate to protect the rights, property, or safety of the Company, our customers, or others.</li>
|
||||
</ul>
|
||||
|
||||
<h2>Changes to our privacy policy</h2>
|
||||
<p>It is our policy to post any changes we make to our privacy policy on this page. The date the privacy policy was last revised is identified at the top of the page. You are responsible for periodically visiting our Website and this privacy policy to check for any changes.</p>
|
||||
<p>It is our policy to post any changes we make to our privacy policy on this page. The date the privacy policy was last revised is identified at the top of the page. You are responsible for periodically visiting our Website and this privacy policy to check for any changes.</p>
|
||||
|
@@ -7,7 +7,7 @@
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<h2 class="border-bottom pb-2">{{'quality-assurance.source'| translate}}</h2>
|
||||
<h2 class="h4 border-bottom pb-2">{{'quality-assurance.source'| translate}}</h2>
|
||||
|
||||
<ds-loading class="container" *ngIf="(isSourceLoading() | async)" message="{{'quality-assurance.loading' | translate}}"></ds-loading>
|
||||
<ds-pagination *ngIf="(isSourceLoading() | async) !== true"
|
||||
|
@@ -44,7 +44,6 @@
|
||||
<td>{{tableEntry.info}}</td>
|
||||
<td>
|
||||
<button [attr.aria-label]="'process.overview.delete-process' | translate"
|
||||
aria-hidden="true"
|
||||
(click)="processBulkDeleteService.toggleDelete(tableEntry.process.processId)"
|
||||
class="btn btn-outline-danger">
|
||||
<i class="fas fa-trash"></i>
|
||||
|
@@ -31,6 +31,7 @@
|
||||
</button>
|
||||
</ng-container>
|
||||
<button *ngIf="loading"
|
||||
title="{{'loading.default' | translate}}"
|
||||
class="list-group-item list-group-item-action border-0 list-entry">
|
||||
<ds-loading [showMessage]="false"></ds-loading>
|
||||
</button>
|
||||
|
@@ -6,5 +6,6 @@
|
||||
(click)="activate($event)"
|
||||
(keyup.space)="activate($event)"
|
||||
(keyup.enter)="activate($event)"
|
||||
[attr.data-test]="item.text"
|
||||
>{{item.text | translate}}</a>
|
||||
<span *ngIf="item.disabled" class="nav-item nav-link disabled">{{item.text | translate}}</span>
|
||||
<span *ngIf="item.disabled" [attr.data-test]="item.text" class="nav-item nav-link disabled">{{item.text | translate}}</span>
|
||||
|
@@ -39,7 +39,8 @@
|
||||
|
||||
<div *ngIf="shouldShowBottomPager | async">
|
||||
<div *ngIf="showPaginator" class="pagination justify-content-center clearfix bottom">
|
||||
<ngb-pagination [boundaryLinks]="paginationOptions.boundaryLinks"
|
||||
<ngb-pagination [attr.aria-label]="('pagination-control.page-number-bar' | translate) + paginationOptions.id"
|
||||
[boundaryLinks]="paginationOptions.boundaryLinks"
|
||||
[collectionSize]="collectionSize"
|
||||
[disabled]="paginationOptions.disabled"
|
||||
[ellipses]="paginationOptions.ellipses"
|
||||
|
@@ -1,4 +1,4 @@
|
||||
<div class="thumbnail" [class.limit-width]="limitWidth" *ngVar="(isLoading$ | async) as isLoading">
|
||||
<div class="thumbnail" [class.limit-width]="limitWidth">
|
||||
<div *ngIf="isLoading" class="thumbnail-content outer">
|
||||
<div class="inner">
|
||||
<div class="centered">
|
||||
@@ -6,16 +6,14 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<ng-container *ngVar="(src$ | async) as src">
|
||||
<!-- don't use *ngIf="!isLoading" so the thumbnail can load in while the animation is playing -->
|
||||
<img *ngIf="src !== null" class="thumbnail-content img-fluid" [ngClass]="{'d-none': isLoading}"
|
||||
[src]="src | dsSafeUrl" [alt]="alt | translate" (error)="errorHandler()" (load)="successHandler()">
|
||||
<div *ngIf="src === null && !isLoading" class="thumbnail-content outer">
|
||||
<div class="inner">
|
||||
<div class="thumbnail-placeholder centered lead">
|
||||
{{ placeholder | translate }}
|
||||
</div>
|
||||
<!-- don't use *ngIf="!isLoading" so the thumbnail can load in while the animation is playing -->
|
||||
<img *ngIf="src !== null" class="thumbnail-content img-fluid" [ngClass]="{'d-none': isLoading}"
|
||||
[src]="src | dsSafeUrl" [alt]="alt | translate" (error)="errorHandler()" (load)="successHandler()">
|
||||
<div *ngIf="src === null && !isLoading" class="thumbnail-content outer">
|
||||
<div class="inner">
|
||||
<div class="thumbnail-placeholder centered lead">
|
||||
{{ placeholder | translate }}
|
||||
</div>
|
||||
</div>
|
||||
</ng-container>
|
||||
</div>
|
||||
</div>
|
||||
|
@@ -96,31 +96,31 @@ describe('ThumbnailComponent', () => {
|
||||
|
||||
describe('loading', () => {
|
||||
it('should start out with isLoading$ true', () => {
|
||||
expect(comp.isLoading$.getValue()).toBeTrue();
|
||||
expect(comp.isLoading).toBeTrue();
|
||||
});
|
||||
|
||||
it('should set isLoading$ to false once an image is successfully loaded', () => {
|
||||
comp.setSrc('http://bit.stream');
|
||||
fixture.debugElement.query(By.css('img.thumbnail-content')).triggerEventHandler('load', new Event('load'));
|
||||
expect(comp.isLoading$.getValue()).toBeFalse();
|
||||
expect(comp.isLoading).toBeFalse();
|
||||
});
|
||||
|
||||
it('should set isLoading$ to false once the src is set to null', () => {
|
||||
comp.setSrc(null);
|
||||
expect(comp.isLoading$.getValue()).toBeFalse();
|
||||
expect(comp.isLoading).toBeFalse();
|
||||
});
|
||||
|
||||
it('should show a loading animation while isLoading$ is true', () => {
|
||||
expect(de.query(By.css('ds-loading'))).toBeTruthy();
|
||||
|
||||
comp.isLoading$.next(false);
|
||||
comp.isLoading = false;
|
||||
fixture.detectChanges();
|
||||
expect(fixture.debugElement.query(By.css('ds-loading'))).toBeFalsy();
|
||||
});
|
||||
|
||||
describe('with a thumbnail image', () => {
|
||||
beforeEach(() => {
|
||||
comp.src$.next('https://bit.stream');
|
||||
comp.src = 'https://bit.stream';
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
@@ -129,7 +129,7 @@ describe('ThumbnailComponent', () => {
|
||||
expect(img).toBeTruthy();
|
||||
expect(img.classes['d-none']).toBeTrue();
|
||||
|
||||
comp.isLoading$.next(false);
|
||||
comp.isLoading = false;
|
||||
fixture.detectChanges();
|
||||
img = fixture.debugElement.query(By.css('img.thumbnail-content'));
|
||||
expect(img).toBeTruthy();
|
||||
@@ -140,14 +140,14 @@ describe('ThumbnailComponent', () => {
|
||||
|
||||
describe('without a thumbnail image', () => {
|
||||
beforeEach(() => {
|
||||
comp.src$.next(null);
|
||||
comp.src = null;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it('should only show the HTML placeholder once done loading', () => {
|
||||
expect(fixture.debugElement.query(By.css('div.thumbnail-placeholder'))).toBeFalsy();
|
||||
|
||||
comp.isLoading$.next(false);
|
||||
comp.isLoading = false;
|
||||
fixture.detectChanges();
|
||||
expect(fixture.debugElement.query(By.css('div.thumbnail-placeholder'))).toBeTruthy();
|
||||
});
|
||||
@@ -243,14 +243,14 @@ describe('ThumbnailComponent', () => {
|
||||
describe('fallback', () => {
|
||||
describe('if there is a default image', () => {
|
||||
it('should display the default image', () => {
|
||||
comp.src$.next('http://bit.stream');
|
||||
comp.src = 'http://bit.stream';
|
||||
comp.defaultImage = 'http://default.img';
|
||||
comp.errorHandler();
|
||||
expect(comp.src$.getValue()).toBe(comp.defaultImage);
|
||||
expect(comp.src).toBe(comp.defaultImage);
|
||||
});
|
||||
|
||||
it('should include the alt text', () => {
|
||||
comp.src$.next('http://bit.stream');
|
||||
comp.src = 'http://bit.stream';
|
||||
comp.defaultImage = 'http://default.img';
|
||||
comp.errorHandler();
|
||||
|
||||
@@ -262,10 +262,10 @@ describe('ThumbnailComponent', () => {
|
||||
|
||||
describe('if there is no default image', () => {
|
||||
it('should display the HTML placeholder', () => {
|
||||
comp.src$.next('http://default.img');
|
||||
comp.src = 'http://default.img';
|
||||
comp.defaultImage = null;
|
||||
comp.errorHandler();
|
||||
expect(comp.src$.getValue()).toBe(null);
|
||||
expect(comp.src).toBe(null);
|
||||
|
||||
fixture.detectChanges();
|
||||
const placeholder = fixture.debugElement.query(By.css('div.thumbnail-placeholder')).nativeElement;
|
||||
@@ -357,7 +357,7 @@ describe('ThumbnailComponent', () => {
|
||||
it('should show the default image', () => {
|
||||
comp.defaultImage = 'default/image.jpg';
|
||||
comp.ngOnChanges({});
|
||||
expect(comp.src$.getValue()).toBe('default/image.jpg');
|
||||
expect(comp.src).toBe('default/image.jpg');
|
||||
});
|
||||
});
|
||||
});
|
||||
|
@@ -6,10 +6,7 @@ import {
|
||||
SimpleChanges,
|
||||
} from '@angular/core';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
import {
|
||||
BehaviorSubject,
|
||||
of as observableOf,
|
||||
} from 'rxjs';
|
||||
import { of as observableOf } from 'rxjs';
|
||||
import { switchMap } from 'rxjs/operators';
|
||||
|
||||
import { AuthService } from '../core/auth/auth.service';
|
||||
@@ -53,7 +50,7 @@ export class ThumbnailComponent implements OnChanges {
|
||||
/**
|
||||
* The src attribute used in the template to render the image.
|
||||
*/
|
||||
src$ = new BehaviorSubject<string>(undefined);
|
||||
src: string = undefined;
|
||||
|
||||
retriedWithToken = false;
|
||||
|
||||
@@ -76,7 +73,7 @@ export class ThumbnailComponent implements OnChanges {
|
||||
* Whether the thumbnail is currently loading
|
||||
* Start out as true to avoid flashing the alt text while a thumbnail is being loaded.
|
||||
*/
|
||||
isLoading$ = new BehaviorSubject(true);
|
||||
isLoading = true;
|
||||
|
||||
constructor(
|
||||
protected auth: AuthService,
|
||||
@@ -129,7 +126,7 @@ export class ThumbnailComponent implements OnChanges {
|
||||
* Otherwise, fall back to the default image or a HTML placeholder
|
||||
*/
|
||||
errorHandler() {
|
||||
const src = this.src$.getValue();
|
||||
const src = this.src;
|
||||
const thumbnail = this.bitstream;
|
||||
const thumbnailSrc = thumbnail?._links?.content?.href;
|
||||
|
||||
@@ -181,9 +178,9 @@ export class ThumbnailComponent implements OnChanges {
|
||||
* @param src
|
||||
*/
|
||||
setSrc(src: string): void {
|
||||
this.src$.next(src);
|
||||
this.src = src;
|
||||
if (src === null) {
|
||||
this.isLoading$.next(false);
|
||||
this.isLoading = false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -191,6 +188,6 @@ export class ThumbnailComponent implements OnChanges {
|
||||
* Stop the loading animation once the thumbnail is successfully loaded
|
||||
*/
|
||||
successHandler() {
|
||||
this.isLoading$.next(false);
|
||||
this.isLoading = false;
|
||||
}
|
||||
}
|
||||
|
@@ -1048,6 +1048,8 @@
|
||||
|
||||
"pagination.next.button.disabled.tooltip": "No more pages of results",
|
||||
|
||||
"pagination.page-number-bar": "Control bar for page navigation, relative to element with ID: ",
|
||||
|
||||
"browse.startsWith": ", starting with {{ startsWith }}",
|
||||
|
||||
"browse.startsWith.choose_start": "(Choose start)",
|
||||
|
@@ -2053,7 +2053,7 @@
|
||||
"community.all-lists.head": "Sous-communautés et collections",
|
||||
|
||||
// "community.sub-collection-list.head": "Collections of this Community",
|
||||
"community.sub-collection-list.head": "collections au sein de cette communauté",
|
||||
"community.sub-collection-list.head": "Collections au sein de cette communauté",
|
||||
|
||||
// "community.sub-community-list.head": "Communities of this Community",
|
||||
"community.sub-community-list.head": "Sous-communautés au sein de cette communauté",
|
||||
|
@@ -466,3 +466,11 @@ ngb-accordion {
|
||||
.mt-ncs { margin-top: calc(var(--ds-content-spacing) * -1); }
|
||||
.mb-ncs { margin-bottom: calc(var(--ds-content-spacing) * -1); }
|
||||
.my-ncs { margin-top: calc(var(--ds-content-spacing) * -1); margin-bottom: calc(var(--ds-content-spacing) * -1); }
|
||||
|
||||
|
||||
.link-contrast {
|
||||
// Rules for accessibility to meet minimum contrast and have an identifiable link between other texts
|
||||
color: darken($link-color, 5%);
|
||||
// We use underline to discern link from text as we can't make color lighter on a white bg
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
Reference in New Issue
Block a user