Skip to content
This repository was archived by the owner on Jun 3, 2022. It is now read-only.

Commit c269d29

Browse files
committed
Merge branch 'release/v0.2.0' into stable
2 parents 03150b5 + e07632d commit c269d29

File tree

9 files changed

+160
-20
lines changed

9 files changed

+160
-20
lines changed

.travis.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
language: node_js
2+
cache:
3+
directories:
4+
- node_modules
5+
sudo: false
6+
node_js:
7+
- "stable"
8+
before_script:
9+
- "export CHROME_BIN=chromium-browser"
10+
- "export DISPLAY=:99.0"
11+
- "sh -e /etc/init.d/xvfb start"
12+
install:
13+
- npm install
14+
after_success:
15+
- npm run codecov
16+
notifications:
17+
email: false

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
## 0.2.0
2+
3+
* [Updates to latest remixer dependency.](https://github.com/material-foundation/material-remixer-remote-web/commit/404ba8ed557ceacdde2d74432e3b2ffc3093011a)
4+
5+
## 0.1.0
6+
7+
Initial release.

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# Remixer Remote for Web
22

3+
[![Build Status](https://travis-ci.org/material-foundation/material-remixer-remote-web.svg?branch=develop)](https://travis-ci.org/material-foundation/material-remixer-remote-web) [![npm version](https://badge.fury.io/js/material-remixer-remote-web.svg)](https://badge.fury.io/js/material-remixer-remote-web)
4+
35
If enabled, the variables defined in your app will be exposed on a remote controller website that you can set up using Firebase hosting. Share the link to this site with your teammates from within the Remixer overlay or by emailing them. The remote controller allows updating the defined variables, and changes will be propagated in real-time across associated apps.
46

57
**New to Remixer?** Visit our [main repo](https://github.com/material-foundation/material-remixer) to get a full description of what it is and how it works.

karma.conf.js

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
/** @license
2+
* Copyright 2016 Google Inc. All Rights Reserved.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
5+
* use this file except in compliance with the License. You may obtain a copy
6+
* of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12+
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13+
* License for the specific language governing permissions and limitations
14+
* under the License.
15+
*/
16+
17+
const webpackConfig = require('./webpack.config.js');
18+
19+
module.exports = function(config) {
20+
config.set({
21+
basePath: '',
22+
frameworks: ['mocha'],
23+
browsers: ['PhantomJS'],
24+
reporters: ['progress', 'coverage'],
25+
client: {
26+
mocha: {
27+
reporter: 'html',
28+
},
29+
},
30+
coverageReporter: {
31+
dir: 'coverage',
32+
reporters: [{
33+
type: 'text'
34+
}, {
35+
type: 'lcov'
36+
}]
37+
},
38+
files: [
39+
'src/**/__tests__/*.ts?(x)',
40+
],
41+
preprocessors: {
42+
'src/**/*.ts?(x)': ['webpack'],
43+
},
44+
webpack: {
45+
devtool: webpackConfig.devtool,
46+
module: webpackConfig.module,
47+
resolve: webpackConfig.resolve,
48+
externals: webpackConfig.externals
49+
},
50+
mime: {
51+
'text/x-typescript': ['ts', 'tsx'],
52+
},
53+
port: 9876,
54+
colors: true,
55+
logLevel: config.LOG_INFO,
56+
autoWatch: true,
57+
singleRun: true,
58+
concurrency: Infinity,
59+
});
60+
};

package.json

Lines changed: 22 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "material-remixer-remote-web",
3-
"version": "0.1.0",
3+
"version": "0.2.0",
44
"description": "A hosted remote controller for a Remixer target app.",
55
"homepage": "https://github.com/material-foundation/material-remixer",
66
"author": "The Material Remixer Authors (see AUTHORS)",
@@ -25,34 +25,50 @@
2525
"clean:pub": "del-cli public/**",
2626
"clean": "npm-run-all --parallel clean:build clean:pub",
2727
"copy": "copyFiles -f src/*.{html,css,svg,ico} build/*.* public",
28+
"codecov": "cat coverage/*/lcov.info | codecov",
2829
"deploy": "npm run dist && firebase deploy",
2930
"dev": "npm run clean:build && npm run build && cross-env RMX_ENV=production webpack-dev-server",
30-
"dist": "npm run clean && npm run build && npm run copy"
31+
"dist": "npm run clean && npm run build && npm run copy",
32+
"test": "karma start"
3133
},
3234
"devDependencies": {
35+
"@types/chai": "^3.4.35",
3336
"@types/lodash.throttle": "^4.1.1",
37+
"@types/mocha": "^2.2.39",
3438
"@types/react": "^0.14.50",
39+
"@types/react-addons-test-utils": "^0.14.17",
3540
"@types/react-dom": "^0.14.19",
3641
"@types/tinycolor2": "^1.1.0",
3742
"@types/uuid": "^2.0.29",
43+
"chai": "^3.5.0",
44+
"codecov.io": "^0.1.6",
3845
"copyfiles": "^1.0.0",
3946
"cross-env": "^3.1.3",
4047
"css-loader": "^0.26.1",
4148
"del-cli": "^0.2.0",
4249
"firebase-tools": "^3.2.0",
4350
"html-loader": "^0.4.4",
51+
"istanbul-instrumenter-loader": "^2.0.0",
52+
"karma": "^1.5.0",
53+
"karma-chai": "^0.1.0",
54+
"karma-coverage": "^1.1.1",
55+
"karma-mocha": "^1.3.0",
56+
"karma-phantomjs-launcher": "^1.0.2",
57+
"karma-webpack": "^2.0.2",
4458
"less": "^2.7.2",
4559
"less-loader": "^2.2.3",
4660
"mkdirp": "^0.5.1",
61+
"mocha": "^3.2.0",
4762
"npm-run-all": "^3.1.2",
63+
"react-addons-test-utils": "^15.4.2",
4864
"style-loader": "^0.13.1",
4965
"ts-loader": "^1.3.1",
5066
"tslint": "^4.0.2",
51-
"typescript": "^2.1.4",
52-
"webpack": "^2.2.0-rc.3",
53-
"webpack-dev-server": "^2.2.0-rc.0"
67+
"typescript": "^2.1.6",
68+
"webpack": "^2.2.0",
69+
"webpack-dev-server": "^2.2.0"
5470
},
5571
"dependencies": {
56-
"material-remixer": "^0.5.8"
72+
"material-remixer": "^0.6.4"
5773
}
5874
}

src/RemoteController.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,9 +123,10 @@ class RemoteController {
123123
ReactDOM.render(
124124
<PageLayout>
125125
<OverlayController
126-
wrapperElement={overlayWrapper}
127-
variables={this.variables}
126+
toggleRemoteEnabled={null}
128127
updateVariable={this.updateVariable.bind(this)}
128+
variables={this.variables}
129+
wrapperElement={overlayWrapper}
129130
/>
130131
</PageLayout>,
131132
overlayWrapper,
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
import * as React from "react";
2+
import * as TestUtils from "react-addons-test-utils";
3+
import * as chai from "chai";
4+
5+
import { remixer } from "../../node_modules/material-remixer/src/core/Remixer";
6+
import { CSS } from "../../node_modules/material-remixer/src/lib/Constants";
7+
import { TextFieldControl } from "../../node_modules/material-remixer/src/ui/controls/TextFieldControl";
8+
import { Variable } from "../../node_modules/material-remixer/src/core/variables/Variable";
9+
10+
const expect = chai.expect;
11+
12+
describe("TextFieldControl", () => {
13+
const key: string = "test_variable";
14+
const initialValue: string = "test string value";
15+
let variable: Variable;
16+
17+
beforeEach(() => {
18+
variable = remixer.addStringVariable(key, initialValue);
19+
variable.selectedValue = initialValue;
20+
this.component = TestUtils.renderIntoDocument(
21+
<TextFieldControl
22+
variable={variable}
23+
updateVariable={null}
24+
/>
25+
);
26+
});
27+
28+
it("should render with proper class name", () => {
29+
let control = TestUtils.findRenderedDOMComponentWithClass(
30+
this.component, CSS.RMX_TEXTFIELD
31+
);
32+
33+
expect(TestUtils.isDOMComponent(control)).to.be.true;
34+
});
35+
36+
it("have correct innertext checked value", () => {
37+
let textField = TestUtils.findRenderedDOMComponentWithClass(
38+
this.component, "mdl-textfield__input"
39+
) as HTMLInputElement;
40+
41+
expect(textField.value).to.equal(initialValue);
42+
});
43+
});

src/index.html

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -29,18 +29,7 @@
2929
</head>
3030

3131
<body>
32-
<div class="mdl-layout mdl-js-layout mdl-layout--fixed-header">
33-
<header class="mdl-layout__header">
34-
<div class="mdl-layout__header-row">
35-
<img src="remixer.svg" alt="Remixer Remote" height="32px;" />
36-
</div>
37-
</header>
38-
<main class="mdl-layout__content">
39-
<div class="page-content">
40-
<div id="remixer-remote"></div>
41-
</div>
42-
</main>
43-
</div>
32+
<div id="remixer-remote"></div>
4433

4534
<script src="remoteController.min.js"></script>
4635
<script>

webpack.config.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,11 @@ module.exports = {
6161
}, {
6262
test: /\.html$/,
6363
loader: 'html-loader'
64+
}, {
65+
test: /\.tsx?$/,
66+
exclude: /(__tests__|node_modules)\//,
67+
loader: 'istanbul-instrumenter-loader',
68+
enforce: 'post'
6469
}],
6570
},
6671
plugins: [

0 commit comments

Comments
 (0)