Skip to content

Commit

Permalink
[IN-4716] Update vega lite dependencies and react script (#81)
Browse files Browse the repository at this point in the history
* Update vega lite dependencies and react script

* update ci node version

* update test

* update cypress

* Replace libpython-dev with python-dev

* update python package

* adds libatk-bridge2.0-dev

* Add gtk library

* use circleci orbs to run cypress test

* update image

* Add cypress test command to build
  • Loading branch information
kennyshittu authored May 2, 2024
1 parent e304a8a commit bfa9158
Show file tree
Hide file tree
Showing 22 changed files with 40,121 additions and 15,417 deletions.
8 changes: 2 additions & 6 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,6 @@ commands:
cypress_tests:
description: Setup and run cypress tests
steps:
- run:
name: Install integration test deps
command: |
sudo apt-get update && sudo apt-get install -qq -y python-pip libpython-dev xvfb libgtk2.0-0 libnotify-dev libgconf-2-4 libnss3 libxss1 libasound2
- run:
name: Run server for tests
command: yarn http-server build/ -p 3500
Expand All @@ -30,7 +26,7 @@ commands:
jobs:
build:
docker:
- image: circleci/node:10
- image: cypress/base:latest
environment:
BASH_ENV: ~/.env
CI: true
Expand All @@ -53,7 +49,7 @@ jobs:
- cypress_tests
build_main:
docker:
- image: circleci/node:10
- image: cimg/node:20.7.0
environment:
BASH_ENV: ~/.env
steps:
Expand Down
32 changes: 32 additions & 0 deletions cypress.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
const { defineConfig } = require('cypress')

module.exports = defineConfig({
blockHosts: ['*.google-analytics.com', '*.mxpnl.com'],

hosts: {
'api.data.world': '127.0.0.1'
},

reporter: 'junit',

reporterOptions: {
mochaFile: 'cypress/junit-results/my-test-output.xml',
toConsole: true
},

e2e: {
// We've imported your old cypress plugins here.
// You may want to clean this up later by importing these.
setupNodeEvents(on, config) {
return require('./cypress/plugins/index.js')(on, config)
},
baseUrl: 'http://localhost:3500'
},

component: {
devServer: {
framework: 'create-react-app',
bundler: 'webpack'
}
}
})
12 changes: 0 additions & 12 deletions cypress.json

This file was deleted.

2 changes: 2 additions & 0 deletions cypress/integration/spec.js → cypress/e2e/spec.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ describe('Chart Builder', function() {
}
}

cy.once('uncaught:exception', () => false)

cy.fixture('profile').as('profile')
cy.fixture('queryResponse').as('queryResponse')

Expand Down
12 changes: 12 additions & 0 deletions cypress/support/component-index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<title>Components App</title>
</head>
<body>
<div data-cy-root></div>
</body>
</html>
27 changes: 27 additions & 0 deletions cypress/support/component.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
// ***********************************************************
// This example support/component.js is processed and
// loaded automatically before your test files.
//
// This is a great place to put global configuration and
// behavior that modifies Cypress.
//
// You can change the location of this file or turn off
// automatically serving support files with the
// 'supportFile' configuration option.
//
// You can read more here:
// https://on.cypress.io/configuration
// ***********************************************************

// Import commands.js using ES2015 syntax:
import './commands'

// Alternatively you can use CommonJS syntax:
// require('./commands')

import { mount } from 'cypress/react'

Cypress.Commands.add('mount', mount)

// Example use:
// cy.mount(<MyComponent />)
File renamed without changes.
13 changes: 7 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,23 +28,24 @@
"react-measure": "3.0.0-rc.3",
"react-monaco-editor": "0.14.1",
"react-router-dom": "4.3.1",
"react-scripts": "2.0.0-next.3e165448",
"react-scripts": "^5.0.1",
"react-select": "2.0.0",
"vega": "5.6.0",
"vega-lite": "3.4.0",
"vega-tooltip": "0.13.0"
"vega": "5.28.0",
"vega-lite": "5.18.0",
"vega-tooltip": "0.34.0"
},
"scripts": {
"start": "react-scripts start",
"dev": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test --env=jsdom",
"test": "react-scripts test",
"eject": "react-scripts eject",
"flow": "flow",
"precommit": "pretty-quick --staged"
},
"devDependencies": {
"cypress": "3.4.1",
"@babel/plugin-proposal-private-property-in-object": "^7.21.11",
"cypress": "13.8.1",
"fetch-mock": "6.5.2",
"http-server": "0.11.1",
"husky": "0.14.3",
Expand Down
4 changes: 2 additions & 2 deletions src/components/Editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ import React, { Component } from 'react'
import debounce from 'lodash/debounce'
import MonacoEditor from 'react-monaco-editor'
import { Measure } from 'react-measure'
import vegaLiteSchema from '../util/vega-lite-schema-v2.json'
import vegaLiteSchema from '../util/vega-lite-schema-v5.json'
import classes from './Editor.module.css'

const monacoJsonSchema = {
uri: 'https://vega.github.io/schema/vega-lite/v2.json',
uri: 'https://vega.github.io/schema/vega-lite/v5.json',
schema: vegaLiteSchema,
fileMatch: ['*']
}
Expand Down
1 change: 0 additions & 1 deletion src/components/SidebarFooter.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
// @flow
/* eslint jsx-a11y/anchor-is-valid: 0 */
import React, { Component } from 'react'
import { decorate, observable } from 'mobx'
import { observer } from 'mobx-react'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ exports[`renders 1`] = `
>
<input
className="form-control"
id={undefined}
readOnly={true}
type="text"
value="test copy"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ exports[`renders loading 1`] = `
>
<input
className="form-control"
id={undefined}
readOnly={true}
type="text"
value="Loading..."
Expand Down
10 changes: 0 additions & 10 deletions src/components/__tests__/__snapshots__/DownloadButton.spec.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,8 @@ exports[`DownloadMenuItem renders 1`] = `
<li
className=""
role="presentation"
style={undefined}
>
<a
data-test={undefined}
download="testing.json"
href="##"
onClick={[Function]}
Expand Down Expand Up @@ -49,14 +47,12 @@ exports[`renders 1`] = `
className="dropdown-header"
onKeyDown={[Function]}
role="heading"
style={undefined}
>
JSON
</li>
<li
className=""
role="presentation"
style={undefined}
>
<a
data-test="download-vega-lite"
Expand All @@ -79,7 +75,6 @@ exports[`renders 1`] = `
<li
className=""
role="presentation"
style={undefined}
>
<a
data-test="download-vega"
Expand All @@ -103,14 +98,12 @@ exports[`renders 1`] = `
className="dropdown-header"
onKeyDown={[Function]}
role="heading"
style={undefined}
>
Image
</li>
<li
className=""
role="presentation"
style={undefined}
>
<a
data-test="download-png"
Expand All @@ -133,7 +126,6 @@ exports[`renders 1`] = `
<li
className=""
role="presentation"
style={undefined}
>
<a
data-test="download-svg"
Expand All @@ -157,14 +149,12 @@ exports[`renders 1`] = `
className="dropdown-header"
onKeyDown={[Function]}
role="heading"
style={undefined}
>
HTML
</li>
<li
className=""
role="presentation"
style={undefined}
>
<a
data-test="download-html"
Expand Down
2 changes: 0 additions & 2 deletions src/components/__tests__/__snapshots__/Encoding.spec.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
exports[`renders 1`] = `
<div
className="container"
data-test={undefined}
>
<div
className="bar"
Expand Down Expand Up @@ -165,7 +164,6 @@ exports[`renders 1`] = `
"valueContainer": [Function],
}
}
value={undefined}
/>
<button
className="btn btn-xs btn-default"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,5 @@ exports[`renders 1`] = `
"valueContainer": [Function],
}
}
value={undefined}
/>
`;
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ exports[`renders 1`] = `
<input
className="form-control"
disabled={false}
id={undefined}
onChange={[Function]}
placeholder="Auto"
type="number"
Expand Down Expand Up @@ -51,7 +50,6 @@ exports[`renders 1`] = `
<input
className="form-control"
disabled={false}
id={undefined}
onChange={[Function]}
placeholder="Auto"
type="number"
Expand Down
6 changes: 0 additions & 6 deletions src/components/__tests__/__snapshots__/Sidebar.spec.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ exports[`renders 1`] = `
<div
className="editTab"
id="configure-tabs"
style={undefined}
>
<ul
className="nav nav-tabs"
Expand All @@ -16,7 +15,6 @@ exports[`renders 1`] = `
<li
className="active"
role="presentation"
style={undefined}
>
<a
aria-controls="configure-tabs-pane-builder"
Expand All @@ -26,15 +24,13 @@ exports[`renders 1`] = `
onClick={[Function]}
onKeyDown={[Function]}
role="tab"
tabIndex={undefined}
>
Visual Builder
</a>
</li>
<li
className=""
role="presentation"
style={undefined}
>
<a
aria-controls="configure-tabs-pane-editor"
Expand Down Expand Up @@ -90,7 +86,6 @@ exports[`renders 1`] = `
>
<react-select
classNamePrefix="react-select"
isClearable={undefined}
isDisabled={false}
menuPortalTarget={<body />}
onChange={[Function]}
Expand Down Expand Up @@ -130,7 +125,6 @@ exports[`renders 1`] = `
},
]
}
placeholder={undefined}
styles={
Object {
"clearIndicator": [Function],
Expand Down
2 changes: 1 addition & 1 deletion src/util/Store.js
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ export const ChartConfig = types
})

return {
$schema: 'https://vega.github.io/schema/vega-lite/v2.json',
$schema: 'https://vega.github.io/schema/vega-lite/v5.json',
title: self.title != null ? self.title : undefined,
width: self.hasFacetField
? undefined
Expand Down
2 changes: 1 addition & 1 deletion src/util/__test__/__snapshots__/Store.spec.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ Object {

exports[`ChartConfig sets a few encodings 2`] = `
Object {
"$schema": "https://vega.github.io/schema/vega-lite/v2.json",
"$schema": "https://vega.github.io/schema/vega-lite/v5.json",
"autosize": undefined,
"config": Object {
"background": "#ffffff",
Expand Down
Loading

0 comments on commit bfa9158

Please sign in to comment.