Skip to content

Commit

Permalink
Merge branch 'gchqgh-7-ui-develop' of https://github.com/jpelbertrios…
Browse files Browse the repository at this point in the history
…/Kai into gchqgh-7-ui-develop
  • Loading branch information
jpelbertrios committed Sep 8, 2020
2 parents 6e727b7 + 6c30484 commit 61e98ee
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 9,243 deletions.
3 changes: 1 addition & 2 deletions ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@
"client": "react-scripts start",
"server": "node server/middleware.js",
"build": "react-scripts build",
"test": "jest",
"test-cov": "jest \"--coverage\"",
"test": "jest \"--coverage\"",
"deploy": "aws s3 sync build/ s3://kai-ui",
"eject": "react-scripts eject"
},
Expand Down
10 changes: 1 addition & 9 deletions ui/src/components/AddGraph/AddGraph.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -101,16 +101,8 @@ export default class AddGraph extends React.Component<{}, IState> {
}
}

private async setFiles(files: Array<File>) {
this.setState({
files: files
});
}

private async getSchema(files: Array<File>) {
const file = await files[0].text();
return file

return await files[0].text();
}

public render() {
Expand Down
9 changes: 3 additions & 6 deletions ui/test/components/AddGraph.test.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
import {mount} from 'enzyme';
import React from 'react';
import AddGraph from "../../src/components/AddGraph/AddGraph";
import {DropzoneArea} from 'material-ui-dropzone'
import Dropzone from 'react-dropzone'
import {fireEvent, render} from '@testing-library/react'
import { act } from 'react-dom/test-utils';
import {DropzoneArea} from 'material-ui-dropzone';

const wrapper = mount(<AddGraph/>);

describe('When AddGraph mounts', () => {

it('should have a Graph Id text field', () => {
Expand All @@ -24,8 +23,6 @@ describe('When AddGraph mounts', () => {
const submitButton = wrapper.find('button').at(2).text();
expect(submitButton).toBe("Add Graph");
});


});
describe('Dropzone behaviour', () => {
it("should fire onChange handler", () => {
Expand Down
11 changes: 4 additions & 7 deletions ui/test/components/UserGuide.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@ import {mount} from 'enzyme';
import React from 'react';
import UserGuide from "../../src/components/UserGuide/UserGuide";
import ReactJson from "react-json-view";

const wrapper = mount(<UserGuide/>);

const exampleJSON= {
"elements": {
"edges": {
Expand Down Expand Up @@ -54,13 +56,8 @@ describe('When UserGuide mounts', () => {
const exampleSchema = wrapper.find('div.react-json-view');

const display= mount(<ReactJson src={exampleJSON} theme="summerfruit:inverted" displayDataTypes={false} displayObjectSize={false} name={"schema"}/>)

expect(exampleSchema).toHaveLength(1);
expect(exampleSchema.html()).toBe(display.html())

});





});
});
3 changes: 0 additions & 3 deletions ui/test/components/__snapshots__/AddGraph.test.tsx.snap

This file was deleted.

Loading

0 comments on commit 61e98ee

Please sign in to comment.