Skip to content

Commit

Permalink
Merge pull request #1542 from BIBSYSDEV/develop
Browse files Browse the repository at this point in the history
Release 01.03.21
  • Loading branch information
elkebab authored Mar 2, 2021
2 parents 28d7f5d + f4033af commit 8eb7ce9
Show file tree
Hide file tree
Showing 103 changed files with 3,110 additions and 2,694 deletions.
1 change: 0 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ module.exports = {
'eslint:recommended', // recommended ESLint rules
'plugin:cypress/recommended', // avoid showing cypress variables as error
'plugin:@typescript-eslint/recommended', // recommended rules from @typescript-eslint/eslint-plugin
'prettier/@typescript-eslint', // Uses eslint-config-prettier to disable ESLint rules from @typescript-eslint/eslint-plugin that would conflict with Prettier.
'plugin:prettier/recommended', // Enables eslint-plugin-prettier and eslint-config-prettier. This will display Prettier errors as ESLint errors. Make sure this is always the last configuration in the extends array.
],
rules: {
Expand Down
6 changes: 4 additions & 2 deletions cypress/integration/registration_references_book.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,11 @@ describe('Registration: References: Book', () => {
cy.contains('Novum Testamentum').click({ force: true });
cy.get('[data-testid=publisher-search-input]').should('have.value', 'Novum Testamentum');

// NPI Subject
cy.selectNpiDiscipline('Linguistics');

// fill out ISBN_LIST field
cy.get('[data-testid=isbn-input]').type('9788202509460').type('{enter}');
cy.get('[data-testid=isbn-input]').type('978-1-78-763271-4');
cy.get('[data-testid=isbn-input]').type('978-1-78-763271-4').type('{enter}').type('9788202509460');
cy.get('[data-testid=is-textbook-checkbox]').click({ force: true });
cy.get('[data-testid=isbn-chip]').should('have.length', 2);

Expand Down
8 changes: 5 additions & 3 deletions cypress/integration/registration_validation.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,11 +101,13 @@ describe('User opens registration form and can see validation errors', () => {

cy.get('[data-testid=nav-tabpanel-description]').click({ force: true });
cy.get('[data-testid=nav-tabpanel-reference]').click({ force: true });
cy.get(`p:contains(${ErrorMessage.REQUIRED})`).should('have.length', 1);
cy.get(`p:contains(${ErrorMessage.REQUIRED})`).should('have.length', 2);

// publicationContext
cy.get('[data-testid=publisher-search-input]').click({ force: true }).type('test');
cy.contains('testament').click({ force: true });
// NPI Subject
cy.selectNpiDiscipline('Linguistics');
cy.contains(ErrorMessage.REQUIRED).should('not.exist');

// ISBN and pages
Expand Down Expand Up @@ -168,14 +170,14 @@ describe('User opens registration form and can see validation errors', () => {

it('The User should be able to see validation errors on contributors tab', () => {
cy.get('[data-testid=nav-tabpanel-contributors]').click({ force: true });
cy.contains(ErrorMessage.MISSING_CONTRIBUTOR).should('be.visible');
cy.contains(ErrorMessage.MISSING_AUTHOR).should('be.visible');

// Add author
cy.get('[data-testid=add-contributor]').click({ force: true });
cy.get('[data-testid=search-input]').click({ force: true }).type('test');
cy.get('[data-testid=author-radio-button]').eq(0).click({ force: true });
cy.get('[data-testid=connect-author-button]').click({ force: true });
cy.contains(ErrorMessage.MISSING_CONTRIBUTOR).should('not.exist');
cy.contains(ErrorMessage.MISSING_AUTHOR).should('not.exist');

// Set corresponding (and email)
cy.get('[data-testid=author-corresponding-checkbox]').click({ force: true });
Expand Down
3 changes: 0 additions & 3 deletions cypress/integration/user.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,6 @@ describe('User connects to their Authority', () => {
// connect orcid
cy.get('[data-testid=connect-to-orcid]').click({ force: true });

// check that author is connected
cy.get('[data-testid=author-connected-info]').should('be.visible');

// check that ORCID is connected
cy.get('[data-testid=orcid-info]').contains('https://sandbox.orcid.org/0000-0001-2345-6789');
});
Expand Down
10 changes: 9 additions & 1 deletion cypress/support/commands.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Cypress.Commands.add('mocklogin', () => {
cy.get('[data-testid=author-radio-button]').eq(1).click({ force: true });
cy.get('[data-testid=connect-author-button]').click({ force: true });
cy.get('[data-testid=modal_next]').click({ force: true });
cy.get('[data-testid=skip-connect-to-orcid]').click({ force: true });
cy.get('[data-testid=cancel-connect-to-orcid]').click({ force: true });

// navigate to profile
cy.get('[data-testid=menu]').click({ force: true });
Expand All @@ -24,6 +24,14 @@ Cypress.Commands.add('startRegistrationWithDoi', () => {
cy.get('[data-testid=registration-link-next-button]').click({ force: true });
});

Cypress.Commands.add('selectNpiDiscipline', (npiDiscipline) => {
cy.get('[data-testid=search_npi]').click({ force: true }).type(npiDiscipline);
cy.contains(npiDiscipline).click({ force: true });
cy.get('[data-testid=search_npi]').within(() => {
cy.get('input').should('have.value', npiDiscipline);
});
});

Cypress.Commands.add('setUserRolesInRedux', (roles) => {
cy.window()
.its('store') // Redux store must be exposed via window.store
Expand Down
Loading

0 comments on commit 8eb7ce9

Please sign in to comment.