Skip to content

Commit

Permalink
feat: upgrade to React 18.3.1
Browse files Browse the repository at this point in the history
  • Loading branch information
Jakub Sobolewski committed May 13, 2024
1 parent 4d69c1a commit d8cd02a
Show file tree
Hide file tree
Showing 20 changed files with 3,497 additions and 3,411 deletions.
6 changes: 4 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,8 @@ jobs:
start: yarn start-e2e-test-app
working-directory: js
record: true
spec: cypress/integration/e2e-test/*.js
spec: cypress/e2e/e2e-test/*.js
config: baseUrl=http://localhost:8887
env:
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}
- name: Run Cypress on example Dashboard
Expand All @@ -68,7 +69,8 @@ jobs:
start: yarn start-e2e-router-app
working-directory: js
record: true
spec: cypress/integration/dashboard/*.js
spec: cypress/e2e/dashboard/*.js
config: baseUrl=http://localhost:8886
env:
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}

Expand Down
3 changes: 1 addition & 2 deletions inst/www/shiny.fluent/shiny-fluent.js

Large diffs are not rendered by default.

6 changes: 5 additions & 1 deletion js/.eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,11 @@ module.exports = {
],
rules: {},
settings: {
'import/resolver': 'webpack',
'import/resolver': {
webpack: {
extensions: ['.js', '.jsx', '.ts', '.tsx']
}
},
react: { version: '17' }
},
};
11 changes: 11 additions & 0 deletions js/cypress.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
const { defineConfig } = require('cypress')

module.exports = defineConfig({
projectId: 'pm6grv',
e2e: {
setupNodeEvents(on, config) {
return require('./cypress/plugins/index.js')(on, config)
},
defaultCommandTimeout: 10000,
},
})
4 changes: 0 additions & 4 deletions js/cypress.json

This file was deleted.

17 changes: 17 additions & 0 deletions js/cypress/e2e/dashboard/dashboard.cy.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
describe('Dashboard', () => {
it('Slider', () => {
cy.visit('/#!/Slider');
const steps = 15;
const arrows = '{rightarrow}'.repeat(steps);

cy.get('#Slider .ms-Slider-slideBox').type(arrows);
cy.contains('Value: 15');
});

it('Dropdown', () => {
cy.visit('/#!/Dropdown');
cy.get('#Dropdown-dropdown-option').click();
cy.get('#Dropdown-dropdown-list2').click();
cy.contains('Value: C');
});
});
Original file line number Diff line number Diff line change
@@ -1,61 +1,44 @@
function test() {
let clicks = 1;
return (name) => {
cy.get(`#actionButtons-${name}`).click();
cy.get('#actionButtons-clicks').should('contain', `Number of clicks: ${clicks}`);
clicks += 1;
};
function testButtonClick(name) {
cy.get(`#actionButtons-${name}`).click();
cy.get('#actionButtons-clicks').should('contain', 'Number of clicks: 1');
}
const testButtonClick = test();

describe('DefaultButton.shinyInput()', () => {
before(() => {
describe('Clicking buttons', () => {
beforeEach(() => {
cy.visit('/');
});

it('click works', () => {
it('DefaultButton.shinyInput()', () => {
testButtonClick('defaultButton');
});
});

describe('PrimaryButton.shinyInput()', () => {
it('click works', () => {
it('PrimaryButton.shinyInput()', () => {
testButtonClick('primaryButton');
});
});

describe('CompoundButton.shinyInput()', () => {
it('click works', () => {
it('CompoundButton.shinyInput()', () => {
testButtonClick('compoundButton');
});
});

describe('ActionButton.shinyInput()', () => {
it('click works', () => {
it('ActionButton.shinyInput()', () => {
testButtonClick('actionButton');
});
});

describe('CommandBarButton.shinyInput()', () => {
it('click works', () => {
it('CommandBarButton.shinyInput()', () => {
testButtonClick('actionButton');
});
});

describe('CommandButton.shinyInput()', () => {
it('click works', () => {
it('CommandButton.shinyInput()', () => {
testButtonClick('actionButton');
});
});

describe('IconButton.shinyInput()', () => {
it('click works', () => {
it('IconButton.shinyInput()', () => {
testButtonClick('actionButton');
});
});

describe('Updating buttons', () => {
before(() => {
beforeEach(() => {
cy.visit('/');
cy.get('#actionButtons-update').click();
});
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
describe('Fluent components inside Shiny tabset', () => {
before(() => {
beforeEach(() => {
cy.visit('/');
cy.get('#deepMixing-tabs1').within(() => {
cy.get('a[data-value=JSX]').click();
Expand All @@ -16,8 +16,10 @@ describe('Fluent components inside Shiny tabset', () => {
});

describe('JSX inside uiOutput inside JSX', () => {
before(() => {
cy.get('[data-cy=deepMixing-pivot] > .ms-Pivot > button[name="Leaflet inside a Pivot"]').click();
beforeEach(() => {
cy.visit('/');
cy.reload();
cy.contains('Leaflet inside a Pivot').click();
});

it('Leaflet inside Pivot is visible', () => {
Expand All @@ -28,9 +30,10 @@ describe('JSX inside uiOutput inside JSX', () => {
});

describe('Leaflet in Pivot in uiOutput in Pivot in uiOutput in JSX', () => {
before(() => {
cy.get('[data-cy=deepMixing-pivot] > .ms-Pivot > button[name="Another level of nesting"]').click();
cy.get('[data-cy=deepMixing-nestedPivot] > .ms-Pivot > button[name="Leaflet inside a Pivot"]').click();
beforeEach(() => {
cy.visit('/');
cy.get('[data-cy=deepMixing-pivot] [data-content="Another level of nesting"]').click();
cy.get('[data-cy=deepMixing-nestedPivot] [data-content="Leaflet inside a Pivot"]').click();
});

it('Leaflet inside nested Pivot is visible', () => {
Expand Down
Loading

0 comments on commit d8cd02a

Please sign in to comment.