Skip to content

Commit 42ce6e6

Browse files
author
Zhou
committed
fix: testing fix
1 parent 8d1eeba commit 42ce6e6

File tree

6 files changed

+39
-47
lines changed

6 files changed

+39
-47
lines changed

src/components/navigationBar/navigationBar.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ function NavigationBar() {
5050
}
5151

5252
return(
53-
<AppBar position="static" backgroundColor="#224878" elevation={0} className={classes.appBar}>
53+
<AppBar position="static" elevation={0} className={classes.appBar}>
5454
<Toolbar className={classes.toolbar}>
5555
<Typography variant="h6" color="inherit" align="left" noWrap className={classes.toolbarTitle}>
5656
Planimation

src/pages/PageOne/dragAndDrop.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React, { Component } from "react";
2-
import styles from "./styles.less";
2+
// import styles from "./styles.less";
33

44
class DragAndDrop extends React.Component {
55
componentDidMount() {
@@ -26,7 +26,7 @@ class DragAndDrop extends React.Component {
2626

2727
render() {
2828
return (
29-
<div ref={(elem) => (this.nv = elem)} className={styles.drop_area}>
29+
<div ref={(elem) => (this.nv = elem)}>
3030
{this.props.name}
3131
</div>
3232
);

src/pages/PageOne/dropAndFetch.jsx

Lines changed: 24 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -5,26 +5,31 @@ import Container from "@material-ui/core/Container";
55
import CloudUploadIcon from "@material-ui/icons/CloudUpload";
66
import css from "./index.module.less";
77

8+
const dragsAndDrops=[
9+
{ name: "Domain", fileType: ".pddl", desc: "or predictes and actions." },
10+
{
11+
name: "Problem",
12+
fileType: ".pddl",
13+
desc: "for objects, initial state and goal.",
14+
},
15+
{
16+
name: "Animation",
17+
fileType: ".pddl",
18+
desc: "object is representation.",
19+
},
20+
];
821
class DropAndFetch extends React.Component {
922
constructor(props) {
1023
super(props);
1124
this.datas = {};
1225
}
1326

14-
state = {
15-
dragsAndDrops: [
16-
{ name: "Domain", fileType: ".pddl", desc: "or predictes and actions." },
17-
{
18-
name: "Problem",
19-
fileType: ".pddl",
20-
desc: "for objects, initial state and goal.",
21-
},
22-
{
23-
name: "Animation",
24-
fileType: ".pddl",
25-
desc: "object is representation.",
26-
},
27-
],
27+
28+
29+
componentWillUnmount = () => {
30+
this.setState = (state, callback) => {
31+
return;
32+
};
2833
};
2934

3035
uploadPDDL = (files) => {
@@ -49,14 +54,14 @@ class DropAndFetch extends React.Component {
4954
return resp;
5055
};
5156

52-
handleSubmit = () => {
57+
handleSubmit = async () => {
5358
//Control check for files
5459
if (
5560
"domain" in this.datas &&
5661
"problem" in this.datas &&
5762
"animation" in this.datas
5863
) {
59-
let resp = this.uploadPDDL(this.datas);
64+
let resp = await this.uploadPDDL(this.datas);
6065
console.log(resp);
6166
} else {
6267
console.log("Some files are missing");
@@ -73,7 +78,7 @@ class DropAndFetch extends React.Component {
7378
<React.Fragment>
7479
<div>
7580
<Container component="main" className={css.dropareaBox}>
76-
{this.state.dragsAndDrops.map((drag) => (
81+
{dragsAndDrops.map((drag) => (
7782
<DropZone
7883
key={drag.name}
7984
name={drag.name}
@@ -83,11 +88,11 @@ class DropAndFetch extends React.Component {
8388
/>
8489
))}
8590
</Container>
86-
<Container maxWidth="sm" component="main" marginTop="50">
91+
<Container maxWidth="sm" component="main">
8792
<div className={css.buttonBox}>
8893
<Button
8994
variant="contained"
90-
color="#224878"
95+
color="default"
9196
onClick={() => this.props.onClick()}
9297
>
9398
Cancel
Lines changed: 8 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,23 @@
1-
.buttonBox {
1+
.dropzoneBox {
22
/*
33
background: #fff;
44
*/
5-
display: flex;
5+
display: inline-block;
66
justify-content: space-around;
7+
width: 30%;
78
padding: 20px;
89
}
910

10-
.textBox {
11-
/*
12-
background: #fff;
13-
*/
14-
display: flex;
15-
justify-content: space-around;
11+
.buttonBox {
1612
padding: 20px;
17-
}
18-
19-
.dropzoneBox {
20-
/*
21-
background: #fff;
22-
*/
23-
display: inline-block;
13+
display: flex;
2414
justify-content: space-around;
25-
width: 30%;
26-
padding: 20px;
2715
}
2816

2917
.dropareaBox {
3018
/*
31-
background: #fff;
32-
*/
19+
background: #fff;
20+
*/
3321
display: flex;
3422
justify-content: space-around;
35-
width: 80%;
36-
}
23+
}

src/pages/PageTwo/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -167,9 +167,9 @@ class PageTwo extends React.Component {
167167

168168
</Container>
169169

170-
<Container maxWidth="sm" component="main" marginTop="50">
170+
<Container maxWidth="sm" component="main">
171171
<div className={css.buttonBox}>
172-
<Button variant="contained" color="#224878" onClick={this.handleOnClick} text-align="left">Cancel</Button>
172+
<Button variant="contained" color="default" onClick={this.handleOnClick} text-align="left">Cancel</Button>
173173
<Button variant="contained" color="primary" startIcon={<CloudUploadIcon />} onClick={()=>{
174174
// eslint-disable-next-line no-restricted-globals
175175
location.href = '/page4';

src/tests/App.test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@ test('renders learn react link', () => {
77
<Router>
88
<App />
99
</Router>);
10-
const linkElement = screen.getByText(/this is app/i);
11-
// expect(linkElement).toBeInTheDocument();
10+
const linkElement = screen.getByText(/Quickly build an visualisation animation form problem or VFG file shows the plan and subplan for each problem./i);
11+
expect(linkElement).toBeInTheDocument();
1212
});

0 commit comments

Comments
 (0)