Skip to content

Commit 0238025

Browse files
committed
uploadfile: action button should take up 100% height.
tests: Fix failing tests update snapshots update snapshots
1 parent fab2f28 commit 0238025

File tree

9 files changed

+66
-110
lines changed

9 files changed

+66
-110
lines changed

src/views/Base/FileOperations/FileUploadModal.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ const FileUploadModal = (props) => {
9595
return (
9696
<div data-test="fileUploadModalComponent">
9797

98-
<Button className="btn-explorer-action" id="UploadButton"
98+
<Button className="btn-explorer-action h-100" id="UploadButton"
9999
onClick={toggle}>
100100
<i className="fa fa-lg fa-upload"/>
101101
</Button>

src/views/Base/FileOperations/__snapshots__/FileOperations.test.js.snap

Lines changed: 55 additions & 100 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,12 @@
11
// Jest Snapshot v1, https://goo.gl/fbAQLP
22

33
exports[`File Operations renders should match snapshot 1`] = `
4-
<Row
5-
className="mt-3 mb-1"
6-
tag="div"
7-
widths={
8-
Array [
9-
"xs",
10-
"sm",
11-
"md",
12-
"lg",
13-
"xl",
14-
]
15-
}
16-
>
17-
<Col
18-
className="pl-0"
19-
lg={2}
20-
md={3}
21-
sm={4}
22-
tag="div"
23-
widths={
24-
Array [
25-
"xs",
26-
"sm",
27-
"md",
28-
"lg",
29-
"xl",
30-
]
4+
<div
5+
className="pl-0 mt-3 mb-1 d-flex justify-content-between align-items-center"
6+
style={
7+
Object {
8+
"marginLeft": "-15px",
9+
"marginRight": "-15px",
3110
}
3211
}
3312
>
@@ -152,10 +131,17 @@ exports[`File Operations renders should match snapshot 1`] = `
152131
flip={true}
153132
tag="div"
154133
>
155-
<Button
156-
className="mr-1 btn-explorer-action p-1"
157-
color="secondary"
158-
id="CreateFolderButton"
134+
<DropdownItem
135+
key="None"
136+
onClick={[Function]}
137+
tag="button"
138+
toggle={true}
139+
value=""
140+
>
141+
None
142+
</DropdownItem>
143+
<DropdownItem
144+
key="Images"
159145
onClick={[Function]}
160146
tag="button"
161147
toggle={true}
@@ -217,6 +203,16 @@ exports[`File Operations renders should match snapshot 1`] = `
217203
>
218204
Show Remote Info
219205
</UncontrolledTooltip>
206+
<FileUploadModal
207+
buttonClass="btn-explorer-action"
208+
buttonLabel="Upload"
209+
currentPath={
210+
Object {
211+
"remoteName": "local",
212+
"remotePath": "",
213+
}
214+
}
215+
/>
220216
<Form
221217
inline={true}
222218
tag="form"
@@ -234,55 +230,20 @@ exports[`File Operations renders should match snapshot 1`] = `
234230
className="fa fa-lg fa-search"
235231
/>
236232
</Button>
237-
<UncontrolledTooltip
238-
placement="right"
239-
target="InfoButton"
240-
>
241-
Show Remote Info
242-
</UncontrolledTooltip>
243-
<FileUploadModal
244-
buttonClass="btn-explorer-action"
245-
buttonLabel="Upload"
246-
currentPath={
247-
Object {
248-
"remoteName": "local",
249-
"remotePath": "",
250-
}
251-
}
252-
/>
253-
<Form
254-
inline={true}
255-
tag="form"
256-
>
257-
<FormGroup
258-
tag="div"
259-
>
260-
<Button
261-
className="mr-1 btn-explorer-action"
262-
color=""
263-
onClick={[Function]}
264-
tag="button"
265-
>
266-
<i
267-
className="fa fa-lg fa-search"
268-
/>
269-
</Button>
270-
</FormGroup>
271-
</Form>
272-
</ButtonGroup>
273-
<Connect(NewFolder)
274-
closeModal={[Function]}
275-
containerID="0"
276-
isVisible={false}
277-
/>
278-
<Modal
279-
autoFocus={true}
280-
backdrop={true}
281-
backdropTransition={
282-
Object {
283-
"mountOnEnter": true,
284-
"timeout": 150,
285-
}
233+
</FormGroup>
234+
</Form>
235+
<Connect(NewFolder)
236+
closeModal={[Function]}
237+
containerID="0"
238+
isVisible={false}
239+
/>
240+
<Modal
241+
autoFocus={true}
242+
backdrop={true}
243+
backdropTransition={
244+
Object {
245+
"mountOnEnter": true,
246+
"timeout": 150,
286247
}
287248
}
288249
centered={false}
@@ -388,24 +349,18 @@ exports[`File Operations renders should match snapshot 1`] = `
388349
onClick={[Function]}
389350
tag="button"
390351
>
391-
<Button
392-
color="danger"
393-
onClick={[Function]}
394-
tag="button"
395-
>
396-
Clean Trash
397-
<i
398-
className="fa fa-lg fa-trash"
399-
/>
400-
</Button>
401-
</Col>
402-
</Row>
403-
</ModalBody>
404-
<ModalFooter
405-
tag="div"
406-
/>
407-
</Modal>
408-
</div>
409-
</Col>
410-
</Row>
352+
Clean Trash
353+
<i
354+
className="fa fa-lg fa-trash"
355+
/>
356+
</Button>
357+
</Col>
358+
</Row>
359+
</ModalBody>
360+
<ModalFooter
361+
tag="div"
362+
/>
363+
</Modal>
364+
</div>
365+
</div>
411366
`;

src/views/Base/FileOperations/__snapshots__/FileUploadModal.test.js.snap

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ exports[`File upload Modal renders should match snapshot 1`] = `
55
data-test="fileUploadModalComponent"
66
>
77
<Button
8-
className="btn-explorer-action"
8+
className="btn-explorer-action h-100"
99
color="secondary"
1010
id="UploadButton"
1111
onClick={[Function]}
@@ -31,6 +31,7 @@ exports[`File upload Modal renders should match snapshot 1`] = `
3131
}
3232
}
3333
centered={false}
34+
container="body"
3435
fade={true}
3536
isOpen={false}
3637
keyboard={true}

src/views/Explorer/FilesView/FileComponent.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -162,8 +162,8 @@ class FileComponent extends React.Component {
162162
</td>
163163
<td>{Size === -1 ? "-" : formatBytes(Size, 2)}</td>
164164
<td className="d-none d-md-table-cell">{modTime.toLocaleDateString()}</td>
165-
<td><Actions downloadHandle={downloadHandle} linkShareHandle={linkShareHandle}
166-
deleteHandle={deleteHandle} item={item}/></td>
165+
<td><FileActions downloadHandle={downloadHandle} linkShareHandle={linkShareHandle}
166+
deleteHandle={deleteHandle} item={item}/></td>
167167
</tr>
168168
)
169169
} else {

src/views/Explorer/FilesView/FilesView.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ const setUp = (intialState = {}, props = {}) => {
1515
};
1616

1717

18-
describe(__filename, function () {
18+
describe("Files View", function () {
1919
describe('renders', function () {
2020
let wrapper;
2121
beforeEach(() => {
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
// Jest Snapshot v1, https://goo.gl/fbAQLP
22

3-
exports[`/media/negativezero/Projects/rclone/rclone-webui-react/src/views/Explorer/FilesView/FilesView.test.js renders should match snapshot 1`] = `""`;
3+
exports[`Files View renders should match snapshot 1`] = `""`;

src/views/Explorer/RemoteExplorerLayout/RemoteExplorerLayout.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ import doublePaneImg from '../../../assets/img/double-pane1.png';
1212
import triplePaneImg from '../../../assets/img/triple-pane.png';
1313
import TabbedPanes from "./TabbedPanes";
1414

15-
import TabsLayout from "../TabsLayout/TabsLayout";
1615
import {DndProvider} from "react-dnd";
1716
import {HTML5Backend} from 'react-dnd-html5-backend';
1817

@@ -117,7 +116,8 @@ RemoteExplorerLayout.propTypes = {
117116
backStacks: PropTypes.object.isRequired,
118117
createPath: PropTypes.func.isRequired,
119118
changeNumCols: PropTypes.func.isRequired,
120-
distractionFreeMode: PropTypes.bool.isRequired
119+
distractionFreeMode: PropTypes.bool.isRequired,
120+
activeRemoteContainerID: PropTypes.object.isRequired
121121
};
122122

123123
export default connect(mapStateToProps, {

src/views/Explorer/RemoteExplorerLayout/RemoteExplorerLayout.test.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@ describe('Remote Explorer Layout', function () {
3131
const initialState = {};
3232

3333
const props = {
34-
createPath: jest.fn()
34+
createPath: jest.fn(),
35+
activeRemoteContainerID: {0: "P14", 1: "38K", 2: "XXN"},
3536
};
3637
wrapper = setUp(initialState, props)
3738
});

src/views/Explorer/RemoteExplorerLayout/TabbedPanes.test.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ const setUp = (initialState = {}, props = {}) => {
1414

1515
describe('Tabbed Panes', function () {
1616

17-
1817
describe('renders', function () {
1918
let wrapper;
2019
beforeEach(() => {

0 commit comments

Comments
 (0)