Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(Travis + Tabbar): Replace react-icons with antD icons in TabBar #455

Closed
wants to merge 6 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 21 additions & 21 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,14 @@ dist: trusty
os:
- osx
- linux
- windows

env:
- NODE_ENV=dev
- NODE_ENV=dev
- NODE_ENV=prod
language: node_js
node_js:
- 8
cache:
yarn: true
directories:
- node_modules
- app/node_modules
- "$HOME/.electron"
- "$HOME/.cache"

- 8
addons:
# chrome: stable
apt:
Expand All @@ -30,12 +24,12 @@ addons:
- xorriso
- desktop-file-utils


before_install:
install:
- travis_retry yarn --network-timeout 600000

before_script:
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then "/Library/Application Support/VMware Tools/vmware-resolutionSet" 1920 1080;
fi
fi
- export DISPLAY=:99.0
- sh -e /etc/init.d/xvfb start &
- sleep 5
Expand All @@ -46,23 +40,27 @@ script:
fi
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then xdg-open --version;
fi
- yarn run build
- yarn build --verbose
- yarn run rebuild
- yarn run test-peruse
# - travis_retry yarn run test-exts # super occasionally times out in tests.

# separate tests for safe + auth as together throws error due to native libs
- export {no_proxy,NO_PROXY}="127.0.0.1,localhost"
- sleep 15

- yarn run package-only
# travis retry the full string to ensure repeat tests dont crash due to first try processess hanging around...
- if [[ "$NODE_ENV" != "prod" ]]; then travis_retry eval " pkill -f electron || pkill -f Peruse || yarn run test-exts-e2e-network";
- if [[ "$NODE_ENV" != "prod" && "$TRAVIS_OS_NAME" != "windows" ]]; then travis_retry eval " pkill -f electron || pkill -f Peruse || yarn run test-exts-e2e-network";
fi
- travis_retry eval " pkill -f electron || pkill -f SAFE Browser || yarn run test-e2e-prod"
- if [[ "$TRAVIS_OS_NAME" != "windows" ]]; then travis_retry eval " pkill -f electron || pkill -f SAFE Browser || yarn run test-e2e-prod";
fi
- if [[ "$TRAVIS_OS_NAME" != "windows" ]]; then travis_retry eval " pkill -f electron || pkill -f SAFE Browser || yarn run test-exts-e2e-prod";
fi
- sleep 5
- travis_retry eval " pkill -f electron || pkill -f SAFE Browser || yarn run test-exts-e2e-prod"

after_success:

- ls release
- export RELEASE="$(ls release)";
- echo "deploying ${RELEASE} to GitHub releases as tagged with ${TRAVIS_TAG}"
Expand All @@ -71,6 +69,8 @@ after_success:
fi
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then zip -r -q ${RELEASE}.zip ${RELEASE};
fi
- if [[ "$TRAVIS_OS_NAME" == "windows" ]]; then 7z a ${RELEASE}.zip ${RELEASE};
fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then zip -d *.zip *.DS_Store && zip -d *.zip __MACOSX/\*;
fi
- cd ..
Expand All @@ -88,24 +88,24 @@ after_failure:
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then system_profiler SPDisplaysDataType | grep Resolution
fi


before_deploy:

- export RELEASE_ZIP="$(ls release/*.zip)";
- echo "deploying ${RELEASE_ZIP} to GitHub releases as tagged with ${TRAVIS_TAG}"
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sha256sum release/*.zip >> release/$RELEASE.txt; fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then shasum -a 256 release/*.zip >> release/$RELEASE.txt; fi
- if [[ "$TRAVIS_OS_NAME" == "windows" ]]; then certutil -hashfile release/*.zip SHA256 >> release/$RELEASE.txt; fi
- export SHA_256_SUM="$(ls release/*.txt)";


deploy:
provider: releases
skip_cleanup: true
api_key: $GITHUB_ACCESS_TOKEN
api_key:
secure: koxiDMX+Hl5fNd5TliLzxKI0H0eIs0elJVs686cfFNiyqnOsBS6wimxC2YK62wk/eXaHZ7gvi1Bfy6GuRnP2fNeLTL3IZ9O9HOcUP2X/jQ12fn5wkewr6DjQx3xlN+/BGSq9IAROMq5ol0moKFBFsu4rX28ovIl2Ft6TIJio8SflM7zZFI4WJa8NNGRBkkr0Dz+MB7fuMWrI3w0paj7BeHoz5ETsmW122plpAgaMQvmpB5k+ZhpCQYE0BwEEdXPAjYLOd6MQl99b0A+bg5ZC4/aJHC6UnCMdtgnzIGSrsNOdLCR8tz6tGv4rlf2TnxH9hKTKqz1N2GmQ4MSBukQpikb6DLcQbbOhjVSPwdWWU8y/O840Y68styYdTddrXJXRnr8sBtykxje1SeB3NaTsaIlSeJu8BfTgZXjJwI46kb3kSQsKHVTDdKfn3MeXEOQpxlZ4EHYEX/ZGc3Wk/uBeGpBMqiN0svdXxZTRaxl43jiJquGsI/3Kp5Q5XPlDp/cVPpCZJjQgw8qeS3fn14axnk373IJF9biSEVdfmfml5UjGX0MwMCip0OgFWvoGlo9VqMnnLYG2ltOI85XdMnZV2DuDPSUw7ODanYhnJFTr4035+TjxpXruO7wg6cuH6YPEUJR+I7pPeSUEX40RNvYsSKW07ZTLBLCkYArTcgRSiQ8=
file:
- "${RELEASE_ZIP}"
- "${SHA_256_SUM}"
draft: true
tag_name: $TRAVIS_TAG
on:
tags: true
tags: true
18 changes: 12 additions & 6 deletions __tests__/components/TabBar.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@ import React from 'react';
import { mount, render, shallow } from 'enzyme';

import TabBar from 'components/TabBar';
import MdClose from 'react-icons/lib/md/close';
import MdAdd from 'react-icons/lib/md/add';
// import MdClose from 'react-icons/lib/md/close';
// import MdAdd from 'react-icons/lib/md/add';
import { CLASSES } from 'appConstants';
import { Spinner } from 'nessie-ui';
import { Button } from 'antd';

describe( 'TabBar', () =>
{
Expand Down Expand Up @@ -53,14 +54,19 @@ describe( 'TabBar', () =>
expect( wrapper.find( '#favicon-img' ).length ).toBe( 1 );
} );

it( 'should have exactly 1 MdAdd component', () =>
it( 'should have exactly 2 button components', () =>
{
expect( wrapper.find( MdAdd ).length ).toBe( 1 );
expect( wrapper.find( Button ).length ).toBe( 2 );
} );

it( 'should have exactly 1 MdClose component', () =>
it( 'should have exactly 1 add tab component', () =>
{
expect( wrapper.find( MdClose ).length ).toBe( 1 );
expect( wrapper.find( `.${CLASSES.ADD_TAB}` ).length ).toBe( 1 );
} );

it( 'should have exactly 1 close tab component', () =>
{
expect( wrapper.find( `.${CLASSES.CLOSE_TAB}` ).length ).toBe( 1 );
} );
} );

Expand Down
24 changes: 17 additions & 7 deletions app/components/TabBar/TabBar.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,14 @@ import url from 'url';
import React, { Component } from 'react';
import PropTypes from 'prop-types';
import styles from './tabBar.css';
import MdClose from 'react-icons/lib/md/close';
import MdAdd from 'react-icons/lib/md/add';
import logger from 'logger';
import { isInternalPage } from 'utils/urlHelpers';
import { CLASSES, INTERNAL_PAGES } from 'appConstants';
import { Column, Spinner, Row } from 'nessie-ui';
import { Col, Button,Icon } from 'antd';
import 'antd/lib/row/style';
import 'antd/lib/col/style';
import 'antd/lib/button/style';

export default class TabBar extends Component
{
Expand Down Expand Up @@ -136,10 +138,13 @@ export default class TabBar extends Component
{ title || 'New Tab' }
</Column>
<Column align="right" className={ styles.favicon }>
<MdClose
className={ `${styles.tabCloseButton} ${CLASSES.CLOSE_TAB}` }
<Button
className={ `${styles.favicon} ${CLASSES.CLOSE_TAB}` }
onClick={ this.handleTabClose.bind( this, tabData ) }
title="Close"
icon="close"
shape="circle"
block="true"
size="small"
/>
</Column>
</Row>
Expand All @@ -155,10 +160,15 @@ export default class TabBar extends Component
{
this.getTabs()
}
<div className={ `${styles.addTab} ${CLASSES.ADD_TAB}` } onClick={ this.handleAddTabClick.bind( this ) }>
<MdAdd
<div className={ `${styles.favicon} ${CLASSES.ADD_TAB}` }>
<Button
onClick={ this.handleAddTabClick.bind( this ) }
className={ styles.tabAddButton }
title="New Tab"
icon="plus"
size="small"
shape="circle"
block="true"
/>
</div>
</div>
Expand Down
5 changes: 3 additions & 2 deletions app/components/TabBar/tabBar.css
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,9 @@

.favicon
{
min-width: 20px;
max-width: 20px;
min-width: 24px;
max-width: 24px;
margin-left: 10px;
}

.favicon img
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ import {
, windowLoaded
} from 'spectron-lib/setupSpectronApp';

jasmine.DEFAULT_TIMEOUT_INTERVAL = DEFAULT_TIMEOUT_INTERVAL + 320000;
jasmine.DEFAULT_TIMEOUT_INTERVAL = DEFAULT_TIMEOUT_INTERVAL + 420000;

const NOTIFICATION_WAIT = WAIT_FOR_EXIST_TIMEOUT + 20000;
const NOTIFICATION_WAIT = WAIT_FOR_EXIST_TIMEOUT + 40000;

console.warn( 'This test runs against a packaged version of the DEV browser. If not built, this will FAIL')
describe( 'SAFE network log in and out', async () =>
Expand Down Expand Up @@ -67,6 +67,7 @@ describe( 'SAFE network log in and out', async () =>
describe( 'account data access', async ( ) =>
{
const { secret, password } = createAccountDetails();
await delay( 10000 );
console.log( 'Creating authed app with deets: ', secret, password );
it( 'can save and reaccess browser bookmark data.', async ( ) =>
{
Expand All @@ -93,7 +94,7 @@ describe( 'SAFE network log in and out', async () =>

// login
await createAccount( app, secret, password, authTab );
await delay( 1500 );
await delay( 9500 );


await setClientToMainBrowserWindow( app );
Expand Down Expand Up @@ -142,9 +143,9 @@ describe( 'SAFE network log in and out', async () =>

await createAccount( app );

await delay( 1500 );
await delay( 9500 );
await setClientToMainBrowserWindow( app );

await delay( 2500 );
await client.waitForExist( BROWSER_UI.NOTIFICATION__ACCEPT, NOTIFICATION_WAIT );
await client.click( BROWSER_UI.NOTIFICATION__ACCEPT );
await delay( 1500 );
Expand Down Expand Up @@ -175,7 +176,7 @@ describe( 'SAFE network log in and out', async () =>
await delay( 1500 );

await login( app, secret, password );
await delay( 1500 );
await delay( 8500 );

await setClientToMainBrowserWindow( app );

Expand Down
1 change: 0 additions & 1 deletion app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
"cross-env": "5.1.3",
"enum": "2.5.0",
"ffi": "2.2.0",
"react-icons": "2.2.7",
"ref": "1.3.5",
"ref-array": "1.2.0",
"ref-struct": "1.1.0",
Expand Down
12 changes: 0 additions & 12 deletions app/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1167,18 +1167,6 @@ rdflib@^0.19.1:
solid-auth-client "^2.2.3"
xmldom "^0.1.22"

[email protected]:
version "2.1.0"
resolved "https://registry.yarnpkg.com/react-icon-base/-/react-icon-base-2.1.0.tgz#a196e33fdf1e7aaa1fda3aefbb68bdad9e82a79d"
integrity sha1-oZbjP98eeqof2jrvu2i9rZ6Cp50=

[email protected]:
version "2.2.7"
resolved "https://registry.yarnpkg.com/react-icons/-/react-icons-2.2.7.tgz#d7860826b258557510dac10680abea5ca23cf650"
integrity sha512-0n4lcGqzJFcIQLoQytLdJCE0DKSA9dkwEZRYoGrIDJZFvIT6Hbajx5mv9geqhqFiNjUgtxg8kPyDfjlhymbGFg==
dependencies:
react-icon-base "2.1.0"

read-pkg-up@^1.0.1:
version "1.0.1"
resolved "https://registry.yarnpkg.com/read-pkg-up/-/read-pkg-up-1.0.1.tgz#9d63c13276c065918d57f002a57f40a1b643fb02"
Expand Down
Loading