Skip to content

Commit a4167f1

Browse files
Andrea BarbassoFrancescoMolinaro
authored andcommitted
Merged in task/dspace-cris-2025_02_x/DSC-2730 (pull request DSpace#4093)
Task/dspace cris 2025 02 x/DSC-2730 Approved-by: Francesco Molinaro
2 parents f93255f + 98f750c commit a4167f1

File tree

14 files changed

+42
-48
lines changed

14 files changed

+42
-48
lines changed

cypress/e2e/admin-search-page.cy.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import { testA11y } from 'cypress/support/utils';
22

3-
// TODO: Enable these tests and fix them before the release
4-
xdescribe('Admin Search Page', () => {
3+
describe('Admin Search Page', () => {
54
beforeEach(() => {
65
// Must login as an Admin to see the page
76
cy.visit('/admin/search');

cypress/e2e/admin-workflow-page.cy.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import { testA11y } from 'cypress/support/utils';
22

3-
// TODO: Enable these tests and fix them before the release
4-
xdescribe('Admin Workflow Page', () => {
3+
describe('Admin Workflow Page', () => {
54
beforeEach(() => {
65
// Must login as an Admin to see the page
76
cy.visit('/admin/workflow');

cypress/e2e/bulk-access.cy.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
import { testA11y } from 'cypress/support/utils';
22
import { Options } from 'cypress-axe';
33

4-
// TODO: Enable these tests and fix them before the release
5-
xdescribe('Bulk Access', () => {
4+
describe('Bulk Access', () => {
65
beforeEach(() => {
76
// Must login as an Admin to see the page
87
cy.visit('/access-control/bulk-access');

cypress/e2e/homepage-statistics.cy.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@ import '../support/commands';
33
import { REGEX_MATCH_NON_EMPTY_TEXT } from 'cypress/support/e2e';
44
import { testA11y } from 'cypress/support/utils';
55

6-
// TODO: Enable these tests and fix them before the release
7-
xdescribe('Site Statistics Page', () => {
6+
describe('Site Statistics Page', () => {
87
it('should load if you click on "Statistics" from homepage', () => {
98
cy.visit('/');
109
cy.get('#expandable-navbar-section-statistics > [data-test="navbar-section-toggler"]').trigger('keyup', { key: 'Enter' });

cypress/e2e/homepage.cy.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { testA11y } from 'cypress/support/utils';
22
import { Options } from 'cypress-axe';
33

44
// TODO: Enable these tests and fix them before the release
5-
xdescribe('Homepage', () => {
5+
describe('Homepage', () => {
66
beforeEach(() => {
77
// All tests start with visiting homepage
88
cy.visit('/');

cypress/e2e/item-statistics.cy.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
import { REGEX_MATCH_NON_EMPTY_TEXT } from 'cypress/support/e2e';
22
import { testA11y } from 'cypress/support/utils';
33

4-
// TODO: Enable these tests and fix them before the release
5-
xdescribe('Item Statistics Page', () => {
4+
describe('Item Statistics Page', () => {
65
const ITEMSTATISTICSPAGE = '/statistics/items/'.concat(Cypress.env('DSPACE_TEST_ENTITY_PUBLICATION'));
76

87
const TOTALVISITSPERMONTHITEMSTATISTICSPAGE = ITEMSTATISTICSPAGE.concat('?reportType=TotalVisitsPerMonth');
@@ -27,7 +26,8 @@ xdescribe('Item Statistics Page', () => {
2726
it('should contain a "Total visits per month" section', () => {
2827
cy.visit(ITEMSTATISTICSPAGE);
2928
// Check just for existence because this table is empty in CI environment as it's historical data
30-
cy.get('.'.concat(Cypress.env('DSPACE_TEST_ENTITY_PUBLICATION')).concat('_TotalVisitsPerMonth')).should('exist');
29+
cy.get('ul.nav > li.nav-item:nth-child(2) > a.nav-link:nth-child(1)').click();
30+
cy.get('ds-statistics-chart-wrapper').should('exist');
3131
});
3232

3333
it('should pass accessibility tests', () => {

cypress/e2e/my-dspace.cy.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import { testA11y } from 'cypress/support/utils';
22

3-
// TODO: Enable these tests and fix them before the release
4-
xdescribe('My DSpace page', () => {
3+
describe('My DSpace page', () => {
54
it('should display recent submissions and pass accessibility tests', () => {
65
cy.visit('/mydspace');
76

cypress/e2e/submission.cy.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@ import { testA11y } from 'cypress/support/utils';
22
//import { TEST_SUBMIT_USER, TEST_SUBMIT_USER_PASSWORD, TEST_SUBMIT_COLLECTION_NAME, TEST_SUBMIT_COLLECTION_UUID, TEST_ADMIN_USER, TEST_ADMIN_PASSWORD } from 'cypress/support/e2e';
33
import { Options } from 'cypress-axe';
44

5-
// TODO: Enable these tests and fix them before the release
6-
xdescribe('New Submission page', () => {
5+
describe('New Submission page', () => {
76

87
// NOTE: We already test that new Item submissions can be started from MyDSpace in my-dspace.spec.ts
98
it('should create a new submission when using /submit path & pass accessibility', () => {

cypress/support/e2e.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,13 @@ before(() => {
5050
cy.task('saveRestBaseDomain', baseDomain);
5151

5252
});
53+
54+
// We might receive uncaught exceptions from external libraries (e.g. it happened before with a broken
55+
// version of the addToAny plugin). These should not cause our tests to fail, so we catch them here.
56+
Cypress.on('uncaught:exception', (err, runnable) => {
57+
// returning false here prevents Cypress from failing the test
58+
return false;
59+
});
5360
});
5461

5562
// Runs once before the first test in each "block"

src/app/core/shared/metadata.utils.spec.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ const testMethod = (fn, resultKind, mapOrMaps, keyOrKeys, hitHighlights, expecte
5454
const keys = keyOrKeys instanceof Array ? keyOrKeys : [keyOrKeys];
5555
describe('and key' + (keys.length === 1 ? (' ' + keys[0]) : ('s ' + JSON.stringify(keys)))
5656
+ ' with ' + (isUndefined(filter) ? 'no filter' : 'filter ' + JSON.stringify(filter)), () => {
57-
const result = fn(mapOrMaps, keys, hitHighlights, filter, limit);
57+
const result = fn(mapOrMaps, keys, hitHighlights, filter, false, limit);
5858
let shouldReturn;
5959
if (resultKind === 'boolean') {
6060
shouldReturn = expected;
@@ -304,10 +304,9 @@ describe('Metadata', () => {
304304

305305
});
306306

307-
// TODO: check why limit seems not to be working (it returns 2 elements instead of 1)
308-
xdescribe('all method with limit', () => {
307+
describe('all method with limit', () => {
309308
const testAllWithLimit = (mapOrMaps, keyOrKeys, expected, limit) =>
310-
testMethod(Metadata.all, 'value', mapOrMaps, keyOrKeys, expected, undefined, limit);
309+
testMethod(Metadata.all, 'value', mapOrMaps, keyOrKeys, undefined, expected, undefined, limit);
311310

312311
describe('with multiMap and limit', () => {
313312
testAllWithLimit(multiMap, 'dc.title', [dcTitle1], 1);

0 commit comments

Comments
 (0)