Skip to content

Commit

Permalink
Merge branch 'release-2.1.2'
Browse files Browse the repository at this point in the history
  • Loading branch information
dy2288 committed Aug 24, 2018
2 parents f5cb059 + b727232 commit aa01946
Show file tree
Hide file tree
Showing 9 changed files with 293 additions and 46 deletions.
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,11 @@ Install dependencies using `yarn add package` or `yarn add package --dev`

We use BroswerStack in order to ensure our UI functions in the latest version of all major browsers, and at least 1 version back depending on demand from our users. We will be posting a more detailed and up-to-date compatibility status in the future.

To run functional tests use:
```
$ gulp karma
```

<a href="https://www.browserstack.com" target="_blank"><img src="app/assets/images/browserstack-logo-600x315.png?raw=true" width="160" alt="BrowserStack" /></a>

## Licensing ##
Expand Down
33 changes: 33 additions & 0 deletions app/assets/javascripts/__tests__/test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import React from 'react';
import TestUtils from 'react/lib/ReactTestUtils'; //I like using the Test Utils, but you can just use the DOM API instead.
import expect from 'expect';
import providers from '../providers/index';
import ConfGlobal from 'conf/local.json';
import AppWrapper from '../views/AppWrapper';
import ThemeManager from 'material-ui/lib/styles/theme-manager';
import FirstVoicesTheme from '../views/themes/FirstVoicesTheme.js';

const context = {
providers,
providedState: {
properties: {
title: ConfGlobal.title,
pageTitleParams: null,
domain: ConfGlobal.domain,
theme: {
palette: ThemeManager.getMuiTheme(FirstVoicesTheme),
id: 'default'
}
}
}
};

/*
Basic test flow to ensure app is rendering
*/
describe('AppWrapper', function () {
it('renders without problems', function () {
var app = TestUtils.renderIntoDocument(<AppWrapper {...context} />);
expect(app).toBeTruthy();
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -225,10 +225,9 @@ export default class View extends Component {
if (phraseDefinitions.length == 0) {
phrases.push(<p key={key}>{phraseLink}</p>);
} else {
phrases.push(<SubViewTranslation key={key} group={phraseDefinitions} groupByElement="language"
groupValue="translation">
<p>{phraseLink}</p>
</SubViewTranslation>);
phrases.push(<p key={key}>{phraseLink} <ul>{phraseDefinitions.map(function (groupValue, key) {
return (<li>{groupValue['translation']} ({groupValue['language']})</li>);
})}</ul></p>);
}
})

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ export default class DialectMedia extends Component {
<FilteredPaginatedMediaList
cols={5}
cellHeight={150}
formValues={{'dc:contributors': selectn("response.properties.username", this.props.computeLogin)}}
initialValues={{'dc:contributors': selectn("response.properties.username", this.props.computeLogin)}}
filterOptionsKey="Resources"
action={this._onNavigateRequest}
fetcher={this.fetchData}
Expand Down
2 changes: 1 addition & 1 deletion app/assets/javascripts/views/pages/search/tile.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ export default class SearchResultTile extends Component {
desc = DOMPurify.sanitize(selectn('properties.fv-portal:about', tile), {ALLOWED_TAGS: []});
desc = (desc.length > 300) ? '...' + desc.substr(desc.indexOf(this.props.searchTerm) - 50, 250) + '...' : desc;

targetPath = selectn('contextParameters.ancestry.dialect.path', tile);
targetPath = '/explore' + selectn('contextParameters.ancestry.dialect.path', tile);
break;

case 'FVBook':
Expand Down
26 changes: 14 additions & 12 deletions gulpfile.js/config/karma.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,18 @@ var config = require('./')
var karmaWebpack = require('karma-webpack')
var webpackConfig = require('./webpack')('test')

module.exports = {
frameworks: ['mocha', 'sinon-chai'],
files: [
'app/assets/javascripts/**/__tests__/*'
],
preprocessors: {
'app/assets/javascripts/**/__tests__/*': ['webpack']
},
webpack: webpackConfig,
singleRun: process.env.TRAVIS_CI === 'true',
reporters: ['nyan'],
browsers: [(process.env.TRAVIS_CI === 'true'? 'Firefox' : 'Chrome')]
module.exports = function(config) {
config.set({
frameworks: ['mocha', 'sinon-chai'],
files: [
'../../app/assets/javascripts/**/__tests__/*'
],
preprocessors: {
'../../app/assets/javascripts/**/__tests__/*': ['webpack']
},
webpack: webpackConfig,
singleRun: process.env.TRAVIS_CI === 'true',
reporters: ['nyan'],
browsers: [(process.env.TRAVIS_CI === 'true'? 'Firefox' : 'Chrome')]
})
}
2 changes: 1 addition & 1 deletion gulpfile.js/tasks/karma.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ var karma = require('karma');

var karmaTask = function(done) {
karma.server.start({
configFile: process.cwd() + '/karma.conf.js',
configFile: process.cwd() + '/gulpfile.js/config/karma.js',
singleRun: true
}, function(exitStatus) {
// Karma's return status is not compatible with gulp's streams
Expand Down
7 changes: 5 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
"request": "~2.65.0",
"require-dir": "~1.0.0",
"selectn": "~1.0.9",
"tcomb-form": "~0.9.0",
"tcomb-form": "~0.9",
"tether-shepherd": "^1.8.1",
"underscore": "~1.8.3",
"vinyl-source-stream": "~0.1.1"
Expand All @@ -60,16 +60,17 @@
"babel-plugin-transform-decorators-legacy": "~1.3.4",
"babel-plugin-transform-react-jsx-component-data-ids": "ssh:https://[email protected]/First-Peoples-Cultural-Council/babel-plugin-transform-react-jsx-component-data-ids.git#v0.1.7",
"babel-plugin-transform-react-jsx-location": "^0.1.5",
"babel-preset-env": "^1.7.0",
"babel-preset-es2015": "^6.24.1",
"babel-preset-react": "~6.24.1",
"babel-preset-stage-0": "~6.24.1",
"babel-preset-env": "^1.7.0",
"bootstrap-webpack": "0.0.3",
"browser-sync": "~2.9.6",
"clean-webpack-plugin": "^0.1.19",
"compression": "~1.4.1",
"css-loader": "~0.14.5",
"del": "~1.2.1",
"expect": "^23.5.0",
"express": "~4.12.2",
"file-loader": "~0.8.4",
"gulp": "~3.9.0",
Expand Down Expand Up @@ -104,8 +105,10 @@
"karma-mocha": "~0.2.1",
"karma-nyan-reporter": "~0.2.3",
"karma-sinon-chai": "~1.1.0",
"karma-webpack": "^3.0.0",
"less": "~2.5.1",
"less-loader": "~2.2.0",
"mocha": "^5.2.0",
"morgan": "~1.5.1",
"open": "0.0.5",
"react-hot-loader": "~1.3.0",
Expand Down
Loading

0 comments on commit aa01946

Please sign in to comment.