Skip to content

Commit

Permalink
uploadfile: action button should take up 100% height.
Browse files Browse the repository at this point in the history
tests: Fix failing tests

update snapshots

update snapshots
  • Loading branch information
negative0 committed Jul 19, 2020
1 parent fab2f28 commit 0238025
Show file tree
Hide file tree
Showing 9 changed files with 66 additions and 110 deletions.
2 changes: 1 addition & 1 deletion src/views/Base/FileOperations/FileUploadModal.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ const FileUploadModal = (props) => {
return (
<div data-test="fileUploadModalComponent">

<Button className="btn-explorer-action" id="UploadButton"
<Button className="btn-explorer-action h-100" id="UploadButton"
onClick={toggle}>
<i className="fa fa-lg fa-upload"/>
</Button>
Expand Down
155 changes: 55 additions & 100 deletions src/views/Base/FileOperations/__snapshots__/FileOperations.test.js.snap
Original file line number Diff line number Diff line change
@@ -1,33 +1,12 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`File Operations renders should match snapshot 1`] = `
<Row
className="mt-3 mb-1"
tag="div"
widths={
Array [
"xs",
"sm",
"md",
"lg",
"xl",
]
}
>
<Col
className="pl-0"
lg={2}
md={3}
sm={4}
tag="div"
widths={
Array [
"xs",
"sm",
"md",
"lg",
"xl",
]
<div
className="pl-0 mt-3 mb-1 d-flex justify-content-between align-items-center"
style={
Object {
"marginLeft": "-15px",
"marginRight": "-15px",
}
}
>
Expand Down Expand Up @@ -152,10 +131,17 @@ exports[`File Operations renders should match snapshot 1`] = `
flip={true}
tag="div"
>
<Button
className="mr-1 btn-explorer-action p-1"
color="secondary"
id="CreateFolderButton"
<DropdownItem
key="None"
onClick={[Function]}
tag="button"
toggle={true}
value=""
>
None
</DropdownItem>
<DropdownItem
key="Images"
onClick={[Function]}
tag="button"
toggle={true}
Expand Down Expand Up @@ -217,6 +203,16 @@ exports[`File Operations renders should match snapshot 1`] = `
>
Show Remote Info
</UncontrolledTooltip>
<FileUploadModal
buttonClass="btn-explorer-action"
buttonLabel="Upload"
currentPath={
Object {
"remoteName": "local",
"remotePath": "",
}
}
/>
<Form
inline={true}
tag="form"
Expand All @@ -234,55 +230,20 @@ exports[`File Operations renders should match snapshot 1`] = `
className="fa fa-lg fa-search"
/>
</Button>
<UncontrolledTooltip
placement="right"
target="InfoButton"
>
Show Remote Info
</UncontrolledTooltip>
<FileUploadModal
buttonClass="btn-explorer-action"
buttonLabel="Upload"
currentPath={
Object {
"remoteName": "local",
"remotePath": "",
}
}
/>
<Form
inline={true}
tag="form"
>
<FormGroup
tag="div"
>
<Button
className="mr-1 btn-explorer-action"
color=""
onClick={[Function]}
tag="button"
>
<i
className="fa fa-lg fa-search"
/>
</Button>
</FormGroup>
</Form>
</ButtonGroup>
<Connect(NewFolder)
closeModal={[Function]}
containerID="0"
isVisible={false}
/>
<Modal
autoFocus={true}
backdrop={true}
backdropTransition={
Object {
"mountOnEnter": true,
"timeout": 150,
}
</FormGroup>
</Form>
<Connect(NewFolder)
closeModal={[Function]}
containerID="0"
isVisible={false}
/>
<Modal
autoFocus={true}
backdrop={true}
backdropTransition={
Object {
"mountOnEnter": true,
"timeout": 150,
}
}
centered={false}
Expand Down Expand Up @@ -388,24 +349,18 @@ exports[`File Operations renders should match snapshot 1`] = `
onClick={[Function]}
tag="button"
>
<Button
color="danger"
onClick={[Function]}
tag="button"
>
Clean Trash
<i
className="fa fa-lg fa-trash"
/>
</Button>
</Col>
</Row>
</ModalBody>
<ModalFooter
tag="div"
/>
</Modal>
</div>
</Col>
</Row>
Clean Trash
<i
className="fa fa-lg fa-trash"
/>
</Button>
</Col>
</Row>
</ModalBody>
<ModalFooter
tag="div"
/>
</Modal>
</div>
</div>
`;
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ exports[`File upload Modal renders should match snapshot 1`] = `
data-test="fileUploadModalComponent"
>
<Button
className="btn-explorer-action"
className="btn-explorer-action h-100"
color="secondary"
id="UploadButton"
onClick={[Function]}
Expand All @@ -31,6 +31,7 @@ exports[`File upload Modal renders should match snapshot 1`] = `
}
}
centered={false}
container="body"
fade={true}
isOpen={false}
keyboard={true}
Expand Down
4 changes: 2 additions & 2 deletions src/views/Explorer/FilesView/FileComponent.js
Original file line number Diff line number Diff line change
Expand Up @@ -162,8 +162,8 @@ class FileComponent extends React.Component {
</td>
<td>{Size === -1 ? "-" : formatBytes(Size, 2)}</td>
<td className="d-none d-md-table-cell">{modTime.toLocaleDateString()}</td>
<td><Actions downloadHandle={downloadHandle} linkShareHandle={linkShareHandle}
deleteHandle={deleteHandle} item={item}/></td>
<td><FileActions downloadHandle={downloadHandle} linkShareHandle={linkShareHandle}
deleteHandle={deleteHandle} item={item}/></td>
</tr>
)
} else {
Expand Down
2 changes: 1 addition & 1 deletion src/views/Explorer/FilesView/FilesView.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const setUp = (intialState = {}, props = {}) => {
};


describe(__filename, function () {
describe("Files View", function () {
describe('renders', function () {
let wrapper;
beforeEach(() => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`/media/negativezero/Projects/rclone/rclone-webui-react/src/views/Explorer/FilesView/FilesView.test.js renders should match snapshot 1`] = `""`;
exports[`Files View renders should match snapshot 1`] = `""`;
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import doublePaneImg from '../../../assets/img/double-pane1.png';
import triplePaneImg from '../../../assets/img/triple-pane.png';
import TabbedPanes from "./TabbedPanes";

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

Expand Down Expand Up @@ -117,7 +116,8 @@ RemoteExplorerLayout.propTypes = {
backStacks: PropTypes.object.isRequired,
createPath: PropTypes.func.isRequired,
changeNumCols: PropTypes.func.isRequired,
distractionFreeMode: PropTypes.bool.isRequired
distractionFreeMode: PropTypes.bool.isRequired,
activeRemoteContainerID: PropTypes.object.isRequired
};

export default connect(mapStateToProps, {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ describe('Remote Explorer Layout', function () {
const initialState = {};

const props = {
createPath: jest.fn()
createPath: jest.fn(),
activeRemoteContainerID: {0: "P14", 1: "38K", 2: "XXN"},
};
wrapper = setUp(initialState, props)
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ const setUp = (initialState = {}, props = {}) => {

describe('Tabbed Panes', function () {


describe('renders', function () {
let wrapper;
beforeEach(() => {
Expand Down

0 comments on commit 0238025

Please sign in to comment.