[ARVADOS-WORKBENCH2] updated: 1.1.4-49-ga234ec2

Git user git at public.curoverse.com
Wed Jun 13 04:30:46 EDT 2018


Summary of changes:
 src/components/breadcrumbs/breadcrumbs.test.tsx | 53 +++++++++++++++++++++++++
 src/components/main-app-bar/main-app-bar.tsx    | 16 +++++---
 2 files changed, 64 insertions(+), 5 deletions(-)
 create mode 100644 src/components/breadcrumbs/breadcrumbs.test.tsx

       via  a234ec2fdf7a257aa1a9268d892e2b6079d4ef55 (commit)
       via  a9949cb9146f46fb002604bd2d27e872f4705b1b (commit)
      from  488c558be1f9b4a9aa48a06d43b97db0d8ff9101 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.


commit a234ec2fdf7a257aa1a9268d892e2b6079d4ef55
Author: Michal Klobukowski <michal.klobukowski at contractors.roche.com>
Date:   Wed Jun 13 10:30:30 2018 +0200

    Create breadcrumbs tests
    
    Feature #13590
    
    Arvados-DCO-1.1-Signed-off-by: Michal Klobukowski <michal.klobukowski at contractors.roche.com>

diff --git a/src/components/breadcrumbs/breadcrumbs.test.tsx b/src/components/breadcrumbs/breadcrumbs.test.tsx
new file mode 100644
index 0000000..77beb49
--- /dev/null
+++ b/src/components/breadcrumbs/breadcrumbs.test.tsx
@@ -0,0 +1,53 @@
+// Copyright (C) The Arvados Authors. All rights reserved.
+//
+// SPDX-License-Identifier: AGPL-3.0
+
+import * as React from "react";
+import { mount, configure } from "enzyme";
+
+import * as Adapter from "enzyme-adapter-react-16";
+import Breadcrumbs from "./breadcrumbs";
+import { Button } from "@material-ui/core";
+import ChevronRightIcon from '@material-ui/icons/ChevronRight';
+
+configure({ adapter: new Adapter() });
+
+describe("<Breadcrumbs />", () => {
+
+    let onClick: () => void;
+
+    beforeEach(() => {
+        onClick = jest.fn();
+    });
+
+    it("renders one item", () => {
+        const items = [
+            {label: 'breadcrumb 1'}
+        ];
+        const breadcrumbs = mount(<Breadcrumbs items={items} onClick={onClick}  />);
+        expect(breadcrumbs.find(Button)).toHaveLength(1);
+        expect(breadcrumbs.find(ChevronRightIcon)).toHaveLength(0);
+    });
+    
+    it("renders multiple items", () => {
+        const items = [
+            {label: 'breadcrumb 1'},
+            {label: 'breadcrumb 2'}
+        ];
+        const breadcrumbs = mount(<Breadcrumbs items={items} onClick={onClick}  />);
+        expect(breadcrumbs.find(Button)).toHaveLength(2);
+        expect(breadcrumbs.find(ChevronRightIcon)).toHaveLength(1);
+    });
+    
+    it("calls onClick with clicked item", () => {
+        const items = [
+            {label: 'breadcrumb 1'},
+            {label: 'breadcrumb 2'}
+        ];
+        const breadcrumbs = mount(<Breadcrumbs items={items} onClick={onClick}  />);
+        breadcrumbs.find(Button).at(1).simulate('click');
+        expect(onClick).toBeCalledWith(items[1]);
+    });
+
+
+});
\ No newline at end of file

commit a9949cb9146f46fb002604bd2d27e872f4705b1b
Author: Michal Klobukowski <michal.klobukowski at contractors.roche.com>
Date:   Wed Jun 13 10:16:32 2018 +0200

    Tighten main app bar
    
    Feature #13590
    
    Arvados-DCO-1.1-Signed-off-by: Michal Klobukowski <michal.klobukowski at contractors.roche.com>

diff --git a/src/components/main-app-bar/main-app-bar.tsx b/src/components/main-app-bar/main-app-bar.tsx
index 4beea60..0626415 100644
--- a/src/components/main-app-bar/main-app-bar.tsx
+++ b/src/components/main-app-bar/main-app-bar.tsx
@@ -43,14 +43,17 @@ export class MainAppBar extends React.Component<MainAppBarProps> {
     render() {
         const { classes, searchText, breadcrumbs, searchDebounce } = this.props;
         return <AppBar className={classes.appBar} position="static">
-            <Toolbar>
+            <Toolbar className={classes.toolbar}>
                 <Grid
                     container
                     justify="space-between"
                 >
                     <Grid item xs={3}>
-                        <Typography variant="title" color="inherit" noWrap style={{ flexGrow: 1 }}>
-                            <span>Arvados</span><br /><span style={{ fontSize: 12 }}>Workbench 2</span>
+                        <Typography variant="headline" color="inherit" noWrap>
+                            Arvados
+                        </Typography>
+                        <Typography variant="body1" color="inherit" noWrap >
+                            Workbench 2
                         </Typography>
                     </Grid>
                     <Grid item xs={6} container alignItems="center">
@@ -70,7 +73,7 @@ export class MainAppBar extends React.Component<MainAppBarProps> {
                 </Grid>
             </Toolbar>
             {
-                this.props.user && <Toolbar>
+                this.props.user && <Toolbar className={classes.toolbar}>
                     <Breadcrumbs items={breadcrumbs} onClick={this.props.onBreadcrumbClick} />
                 </Toolbar>
             }
@@ -116,11 +119,14 @@ export class MainAppBar extends React.Component<MainAppBarProps> {
 
 }
 
-type CssRules = "appBar";
+type CssRules = "appBar" | "toolbar";
 
 const styles: StyleRulesCallback<CssRules> = theme => ({
     appBar: {
         backgroundColor: "#692498"
+    },
+    toolbar: {
+        minHeight: '48px'
     }
 });
 

-----------------------------------------------------------------------


hooks/post-receive
-- 




More information about the arvados-commits mailing list