Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OE-818: Update React, Node, Chakra, and other packages #157

Merged
merged 6 commits into from
Apr 16, 2024
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@ jobs:

steps:
- name: Checkout repo
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Use Node 14
uses: actions/setup-node@v1
- name: Use Node 20
uses: actions/setup-node@v4
with:
node-version: '14'
node-version: '20'
cache: 'npm'

- name: Use NPM 8.x
- name: Use NPM 9.x
run: npm i -g npm@8

- name: Install Dependencies
Expand Down
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v16
v20
39 changes: 28 additions & 11 deletions cypress/integration/multi-pdf/navigations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,19 +33,27 @@ describe('Multi PDF navigation', () => {
});

it('should navigate forward and backwards with page buttons', () => {
cy.findByText('Anthropology without Informants').should('be.visible');
cy.findByText(
'Anthropology without Informants: Collected Works in Paleoanthropology by L.G. Freeman.'
).should('be.visible');
cy.findByRole('button', { name: 'Next Page' }).click();
cy.get('#mainContent')
.find('div[class="react-pdf__Page__textContent"]')
.find('.react-pdf__Page__textContent')
.children()
.should('have.length', 0);
cy.findByText('Anthropology without Informants').should('not.exist');
cy.findByText(
'Anthropology without Informants: Collected Works in Paleoanthropology by L.G. Freeman.'
).should('not.exist');
cy.findByRole('button', { name: 'Previous Page' }).click();
cy.findByText('Anthropology without Informants').should('be.visible');
cy.findByText(
'Anthropology without Informants: Collected Works in Paleoanthropology by L.G. Freeman.'
).should('be.visible');
});

it('should switch to scrolling mode', () => {
cy.findByText('Anthropology without Informants').should('be.visible');
cy.findByText(
'Anthropology without Informants: Collected Works in Paleoanthropology by L.G. Freeman.'
).should('be.visible');
cy.findByRole('button', { name: 'Settings' }).click();
cy.findByText('Scrolling').click();
cy.findByRole('button', { name: 'Next Page' }).click();
Expand All @@ -56,27 +64,36 @@ describe('Multi PDF navigation', () => {
});

it('should navigate between resources with page buttons on scrolling mode', () => {
cy.findByText('Anthropology without Informants').should('be.visible');
cy.findByText(
'Anthropology without Informants: Collected Works in Paleoanthropology by L.G. Freeman.'
).should('be.visible');
cy.findByText('Settings').click();
cy.findByText('Scrolling').click();
cy.findByRole('button', { name: 'Next Page' }).click();
cy.findByText('Anthropology without Informants').should('not.exist');
cy.findByText(
'Anthropology without Informants: Collected Works in Paleoanthropology by L.G. Freeman.'
).should('not.exist');

cy.log('switch from paginated to scrolling');
cy.findByText('Settings').click();
cy.findByText('Paginated').click();
cy.findByRole('button', { name: 'Next Page' }).click();

cy.findByText('Anthropology without Informants').should('not.exist');
cy.findByText(
'Anthropology without Informants: Collected Works in Paleoanthropology by L.G. Freeman.'
).should('not.exist');

cy.findByText('Settings').click();
cy.findByText('Scrolling').click();
cy.findByRole('button', { name: 'Previous Page' }).click();

cy.wait('@pdf');
cy.findByText('Settings').click();
cy.findByText('Zoom Out').click();

cy.findByText('Anthropology without Informants', { timeout: 10000 }).should(
'be.visible'
);
cy.findByText(
'Anthropology without Informants: Collected Works in Paleoanthropology by L.G. Freeman.',
{ timeout: 10000 }
).should('be.visible');
});
});
4 changes: 3 additions & 1 deletion cypress/integration/multi-pdf/render-app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ describe('Renders multi PDF', () => {
cy.findByRole('button', { name: 'Next Page' }).should('not.be.disabled');
cy.findByRole('button', { name: 'Previous Page' }).should('be.disabled');

cy.findByText('Anthropology without Informants').should('be.visible');
cy.findByText(
'Anthropology without Informants: Collected Works in Paleoanthropology by L.G. Freeman.'
).should('be.visible');
});
});
4 changes: 2 additions & 2 deletions cypress/integration/single-pdf/settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@ describe('Single PDF display settings', () => {
});

it('should zoom in and out', () => {
cy.get('div[class="react-pdf__Page__textContent"]')
cy.get('.react-pdf__Page__textContent')
.find('span')
.should(
'have.text',
'ECONOMICS – WORKING PAPERS 2021/03Assessing climate change risks at the country level: the EIB scoring model'
'ECONOMICS – WORKING PAPERS 2021/03Assessing climate changerisks at the country level:the EIB scoring model'
);

cy.get('.react-pdf__Page').then(($elm) => {
Expand Down
2 changes: 1 addition & 1 deletion cypress/support/commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ Cypress.Commands.add(
});
cy.wait('@pdf', { timeout: 50000 });
cy.get('#mainContent')
.find('div[class="react-pdf__Page__textContent"]', { timeout: 10000 })
.find('.react-pdf__Page__textContent', { timeout: 10000 })
.should('have.attr', 'style');
}
);
Loading
Loading