Skip to content

Commit 1c91c75

Browse files
committed
Fetch the right files from the dtq-dev branch
1 parent ee71830 commit 1c91c75

11 files changed

Lines changed: 677 additions & 158 deletions

File tree

.github/disabled-workflows/label_merge_conflicts.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
# This workflow checks open PRs for merge conflicts and labels them when conflicts are found
22
name: Check for merge conflicts
33

4-
# Run this for all pushes (i.e. merges) to 'main' or maintenance branches
4+
# Run whenever the "main" branch is updated
5+
# NOTE: This means merge conflicts are only checked for when a PR is merged to main.
56
on:
67
push:
78
branches: [ main ]

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
[![Build](https://github.com/dataquest-dev/dspace-angular/actions/workflows/build.yml/badge.svg)](https://github.com/dataquest-dev/dspace-angular/actions/workflows/build.yml) [![Coverage Status](https://codecov.io/gh/DSpace/dspace-angular/branch/main/graph/badge.svg)](https://codecov.io/gh/DSpace/dspace-angular) [![Universal Angular](https://img.shields.io/badge/universal-angular2-brightgreen.svg?style=flat)](https://github.com/angular/universal)
1+
[![Build](https://github.com/dataquest-dev/dspace-angular/actions/workflows/build.yml/badge.svg)](https://github.com/dataquest-dev/dspace-angular/actions/workflows/build.yml) [![codecov](https://codecov.io/gh/dataquest-dev/dspace-angular/branch/dtq-dev/graph/badge.svg?token=DQ7QIZN8S6)](https://codecov.io/gh/dataquest-dev/dspace-angular) [![Universal Angular](https://img.shields.io/badge/universal-angular2-brightgreen.svg?style=flat)](https://github.com/angular/universal)
22

33
dspace-angular
44
==============

cypress/e2e/admin-menu.cy.ts

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
import {
2+
TEST_ADMIN_PASSWORD,
3+
TEST_ADMIN_USER,
4+
TEST_SUBMIT_COLLECTION_UUID,
5+
} from '../support/e2e';
6+
7+
/**
8+
* Test menu options for admin
9+
*/
10+
describe('Admin Menu Page', () => {
11+
beforeEach(() => {
12+
// Create a new submission
13+
cy.visit('/submit?collection=' + TEST_SUBMIT_COLLECTION_UUID + '&entityType=none');
14+
15+
// This page is restricted, so we will be shown the login form. Fill it out & submit.
16+
cy.loginViaForm(TEST_ADMIN_USER, TEST_ADMIN_PASSWORD);
17+
});
18+
19+
it('should pass accessibility tests', () => {
20+
// Check handles redirect url in the <a> tag
21+
cy.get('.sidebar-top-level-items a[href = "/handle-table"]').scrollIntoView().should('be.visible');
22+
23+
// Check licenses redirect url in the <a> tag
24+
cy.get('.sidebar-top-level-items a[href = "/licenses/manage-table"]').scrollIntoView().should('be.visible');
25+
});
26+
});

cypress/e2e/login-modal.cy.ts

Lines changed: 139 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,139 @@
1+
import { TEST_ADMIN_PASSWORD, TEST_ADMIN_USER, TEST_ENTITY_PUBLICATION } from 'cypress/support/e2e';
2+
import { testA11y } from 'cypress/support/utils';
3+
4+
const page = {
5+
openLoginMenu() {
6+
// Click the "Log In" dropdown menu in header
7+
cy.get('ds-themed-navbar [data-test="login-menu"]').click();
8+
},
9+
openUserMenu() {
10+
// Once logged in, click the User menu in header
11+
cy.get('ds-themed-navbar [data-test="user-menu"]').click();
12+
},
13+
submitLoginAndPasswordByPressingButton(email, password) {
14+
// Enter email
15+
cy.get('ds-themed-navbar [data-test="email"]').type(email);
16+
// Enter password
17+
cy.get('ds-themed-navbar [data-test="password"]').type(password);
18+
// Click login button
19+
cy.get('ds-themed-navbar [data-test="login-button"]').click();
20+
},
21+
submitLoginAndPasswordByPressingEnter(email, password) {
22+
// In opened Login modal, fill out email & password, then click Enter
23+
cy.get('ds-themed-navbar [data-test="email"]').type(email);
24+
cy.get('ds-themed-navbar [data-test="password"]').type(password);
25+
cy.get('ds-themed-navbar [data-test="password"]').type('{enter}');
26+
},
27+
submitLogoutByPressingButton() {
28+
// This is the POST command that will actually log us out
29+
cy.intercept('POST', '/server/api/authn/logout').as('logout');
30+
// Click logout button
31+
cy.get('ds-themed-navbar [data-test="logout-button"]').click();
32+
// Wait until above POST command responds before continuing
33+
// (This ensures next action waits until logout completes)
34+
cy.wait('@logout');
35+
}
36+
};
37+
38+
// CLARIN - CLARIN-DSpace7.x has different login
39+
// describe('Login Modal', () => {
40+
// it('should login when clicking button & stay on same page', () => {
41+
// const ENTITYPAGE = '/entities/publication/'.concat(TEST_ENTITY_PUBLICATION);
42+
// cy.visit(ENTITYPAGE);
43+
//
44+
// // Login menu should exist
45+
// cy.get('ds-log-in').should('exist');
46+
//
47+
// // Login, and the <ds-log-in> tag should no longer exist
48+
// page.openLoginMenu();
49+
// cy.get('.form-login').should('be.visible');
50+
//
51+
// page.submitLoginAndPasswordByPressingButton(TEST_ADMIN_USER, TEST_ADMIN_PASSWORD);
52+
// cy.get('ds-log-in').should('not.exist');
53+
//
54+
// // Verify we are still on the same page
55+
// cy.url().should('include', ENTITYPAGE);
56+
//
57+
// // Open user menu, verify user menu & logout button now available
58+
// page.openUserMenu();
59+
// cy.get('ds-user-menu').should('be.visible');
60+
// cy.get('ds-log-out').should('be.visible');
61+
// });
62+
//
63+
// it('should login when clicking enter key & stay on same page', () => {
64+
// cy.visit('/home');
65+
//
66+
// // Open login menu in header & verify <ds-log-in> tag is visible
67+
// page.openLoginMenu();
68+
// cy.get('.form-login').should('be.visible');
69+
//
70+
// // Login, and the <ds-log-in> tag should no longer exist
71+
// page.submitLoginAndPasswordByPressingEnter(TEST_ADMIN_USER, TEST_ADMIN_PASSWORD);
72+
// cy.get('.form-login').should('not.exist');
73+
//
74+
// // Verify we are still on homepage
75+
// cy.url().should('include', '/home');
76+
//
77+
// // Open user menu, verify user menu & logout button now available
78+
// page.openUserMenu();
79+
// cy.get('ds-user-menu').should('be.visible');
80+
// cy.get('ds-log-out').should('be.visible');
81+
// });
82+
//
83+
// it('should support logout', () => {
84+
// // First authenticate & access homepage
85+
// cy.login(TEST_ADMIN_USER, TEST_ADMIN_PASSWORD);
86+
// cy.visit('/');
87+
//
88+
// // Verify ds-log-in tag doesn't exist, but ds-log-out tag does exist
89+
// cy.get('ds-log-in').should('not.exist');
90+
// cy.get('ds-log-out').should('exist');
91+
//
92+
// // Click logout button
93+
// page.openUserMenu();
94+
// page.submitLogoutByPressingButton();
95+
//
96+
// // Verify ds-log-in tag now exists
97+
// cy.get('ds-log-in').should('exist');
98+
// cy.get('ds-log-out').should('not.exist');
99+
// });
100+
//
101+
// it('should allow new user registration', () => {
102+
// cy.visit('/');
103+
//
104+
// page.openLoginMenu();
105+
//
106+
// // Registration link should be visible
107+
// cy.get('ds-themed-navbar [data-test="register"]').should('be.visible');
108+
//
109+
// // Click registration link & you should go to registration page
110+
// cy.get('ds-themed-navbar [data-test="register"]').click();
111+
// cy.location('pathname').should('eq', '/register');
112+
// cy.get('ds-register-email').should('exist');
113+
// });
114+
//
115+
// it('should allow forgot password', () => {
116+
// cy.visit('/');
117+
//
118+
// page.openLoginMenu();
119+
//
120+
// // Forgot password link should be visible
121+
// cy.get('ds-themed-navbar [data-test="forgot"]').should('be.visible');
122+
//
123+
// // Click link & you should go to Forgot Password page
124+
// cy.get('ds-themed-navbar [data-test="forgot"]').click();
125+
// cy.location('pathname').should('eq', '/forgot');
126+
// cy.get('ds-forgot-email').should('exist');
127+
// });
128+
//
129+
// it('should pass accessibility tests', () => {
130+
// cy.visit('/');
131+
//
132+
// page.openLoginMenu();
133+
//
134+
// cy.get('ds-log-in').should('exist');
135+
//
136+
// // Analyze <ds-log-in> for accessibility issues
137+
// testA11y('ds-log-in');
138+
// });
139+
// });

0 commit comments

Comments
 (0)