Repository: zooniverse/Panoptes-Front-End
Pull request #5053 (2018-11-07 10:44:25)

Bump @babel/cli from 7.1.2 to 7.1.5
Bumps [@babel/cli](https://github.com/babel/babel) from 7.1.2 to 7.1.5.
<details>
<summary>Release notes</summary>

*Sourced from [@babel/cli's releases](https://github.com/babel/babel/releases).*

> ## v7.1.5 (2018-11-06)
> 
> Various bug fixes and additions.
> 
> And thanks to [**benmosher**](https://github.com/benmosher), [**ryanwmarsh**](https://github.com/ryanwmarsh), [**Cyp**](https://github.com/Cyp), [**vvyomjjain**](https://github.com/vvyomjjain), [**byronluk**](https://github.com/byronluk), [**everdimension**](https://github.com/everdimension) for their first PRs!
> 
> #### :eyeglasses: Spec Compliancy
> * `babel-parser`, `babylon`
>   * [#7727](https://github-redirect.dependabot.com/babel/babel/pull/7727) Fix await in function name and parameters. ([[**nicolo-ribaudo**](https://github.com/nicolo-ribaudo)](https://github.com/nicolo-ribaudo))
> 
> #### :rocket: New Feature
> * `babel-parser`
>   * [#8828](https://github-redirect.dependabot.com/babel/babel/pull/8828) Typescript: Validate tuple type element positions. ([[**Retsam**](https://github.com/Retsam)](https://github.com/Retsam))
>   * [#8883](https://github-redirect.dependabot.com/babel/babel/pull/8883) [flow] Add support for parsing `_` as implicit instantiation in call/new. ([[**jbrown215**](https://github.com/jbrown215)](https://github.com/jbrown215))
> * `babel-core`, `babel-generator`, `babel-parser`, `babel-plugin-syntax-typescript`, `babel-traverse`
>   * [#8448](https://github-redirect.dependabot.com/babel/babel/pull/8448) Remove Babylon plugins for features already merged to the ECMAScript spec. ([[**nicolo-ribaudo**](https://github.com/nicolo-ribaudo)](https://github.com/nicolo-ribaudo))
> * `babel-parser`, `babel-types`
>   * [#8884](https://github-redirect.dependabot.com/babel/babel/pull/8884) [flow] Explicit inexact objects with `...`. ([[**jbrown215**](https://github.com/jbrown215)](https://github.com/jbrown215))
> * `babel-preset-env`
>   * [#8898](https://github-redirect.dependabot.com/babel/babel/pull/8898) Update preset-env data. ([[**existentialism**](https://github.com/existentialism)](https://github.com/existentialism))
> 
> #### :bug: Bug Fix
> * `babel-parser`
>   * [#8956](https://github-redirect.dependabot.com/babel/babel/pull/8956) Do not allow TypeCastExpressions w/o parens . ([[**danez**](https://github.com/danez)](https://github.com/danez))
>   * [#8954](https://github-redirect.dependabot.com/babel/babel/pull/8954) Allow function types in type params within arrow return types. ([[**danez**](https://github.com/danez)](https://github.com/danez))
>   * [#8866](https://github-redirect.dependabot.com/babel/babel/pull/8866) Closes [#8865](https://github-redirect.dependabot.com/babel/babel/issues/8865). ([[**byronluk**](https://github.com/byronluk)](https://github.com/byronluk))
> * `babel-core`
>   * [#8910](https://github-redirect.dependabot.com/babel/babel/pull/8910) Resolve babel.config.js 'babelrcRoots' values relative to the config file.. ([[**loganfsmyth**](https://github.com/loganfsmyth)](https://github.com/loganfsmyth))
>   * [#8950](https://github-redirect.dependabot.com/babel/babel/pull/8950) Fix message when plugin of a wrong type is passed. ([[**everdimension**](https://github.com/everdimension)](https://github.com/everdimension))
> * `babel-plugin-transform-block-scoping`
>   * [#8937](https://github-redirect.dependabot.com/babel/babel/pull/8937) rename colliding let bindings with for loop init. ([[**byronluk**](https://github.com/byronluk)](https://github.com/byronluk))
>   * [#8914](https://github-redirect.dependabot.com/babel/babel/pull/8914) Treat break inside block inside loop. ([[**thiagoarrais**](https://github.com/thiagoarrais)](https://github.com/thiagoarrais))
> * `babel-preset-env`
>   * [#8926](https://github-redirect.dependabot.com/babel/babel/pull/8926) preset-env: Edge support for arrow param destructuring. ([[**benmosher**](https://github.com/benmosher)](https://github.com/benmosher))
> * `babel-generator`
>   * [#8868](https://github-redirect.dependabot.com/babel/babel/pull/8868) fix single-arg async arrows when retainLines=true. ([[**ryanwmarsh**](https://github.com/ryanwmarsh)](https://github.com/ryanwmarsh))
> * `babel-traverse`
>   * [#8880](https://github-redirect.dependabot.com/babel/babel/pull/8880) fix: Expression x === 'y' && '' should not evaluate to undefined.. ([[**Cyp**](https://github.com/Cyp)](https://github.com/Cyp))
> 
> #### :nail_care: Polish
> * [#8873](https://github-redirect.dependabot.com/babel/babel/pull/8873) fixed an extra word. ([[**vvyomjjain**](https://github.com/vvyomjjain)](https://github.com/vvyomjjain))
> 
> #### Committers: 14
> - Ben Mosher ([benmosher](https://github.com/benmosher))
> - Brian Ng ([existentialism](https://github.com/existentialism))
> - Byron Luk ([byronluk](https://github.com/byronluk))
> - Daniel Tschinder ([danez](https://github.com/danez))
> - James Garbutt ([43081j](https://github.com/43081j))
> - Jordan Brown ([jbrown215](https://github.com/jbrown215))
> - Logan Smyth ([loganfsmyth](https://github.com/loganfsmyth))
></table> ... (truncated)
</details>
<details>
<summary>Changelog</summary>

*Sourced from [@babel/cli's changelog](https://github.com/babel/babel/blob/master/CHANGELOG.md).*

> # Changelog
> 
> > **Tags:**
> > - :boom:       [Breaking Change]
> > - :eyeglasses: [Spec Compliancy]
> > - :rocket:     [New Feature]
> > - :bug:        [Bug Fix]
> > - :memo:       [Documentation]
> > - :house:      [Internal]
> > - :nail_care:  [Polish]
> 
> _Note: Gaps between patch versions are faulty, broken or test releases._
> 
> See [CHANGELOG - v4](/.github/CHANGELOG-v4.md), [CHANGELOG - v5](/.github/CHANGELOG-v5.md), and [CHANGELOG - v6](/.github/CHANGELOG-v6.md) for v4.x-v6.x changes.
> See [CHANGELOG - 6to5](/.github/CHANGELOG-6to5.md) for the pre-4.0.0 version changelog.
> See [Babylon's CHANGELOG](packages/babylon/CHANGELOG.md) for the Babylon pre-7.0.0-beta.29 version changelog.
</details>
<details>
<summary>Commits</summary>

- [`afe67a7`](https://github.com/babel/babel/commit/afe67a7035b640394363ea3ae95e8f9a5476ea47) v7.1.5
- [`2fa1984`](https://github.com/babel/babel/commit/2fa19846353a97e33676e819e9ba4f7104aaad3f) Fix await in function name and parameters ([#7727](https://github-redirect.dependabot.com/babel/babel/issues/7727))
- [`2194842`](https://github.com/babel/babel/commit/2194842d11466cf1a3dcdd165e8f1e6505e5d05f) Typescript: Validate tuple type element positions ([#8828](https://github-redirect.dependabot.com/babel/babel/issues/8828))
- [`e3b2c1a`](https://github.com/babel/babel/commit/e3b2c1afff1b42aa260940f825503ab1c78ac26c) fix: Do not allow TypeCastExpressions w/o parens ([#8956](https://github-redirect.dependabot.com/babel/babel/issues/8956))
- [`b95cbc4`](https://github.com/babel/babel/commit/b95cbc4a8e3b564fd108efaf2853a373c04d4f10) output aliased types in typescript declarations ([#8629](https://github-redirect.dependabot.com/babel/babel/issues/8629))
- [`24c4901`](https://github.com/babel/babel/commit/24c4901ff56c57db1ac60e4d810424656d18e374) Remove Babylon plugins for features already merged to the ECMAScript spec ([#8](https://github-redirect.dependabot.com/babel/babel/issues/8)...
- [`c125b1d`](https://github.com/babel/babel/commit/c125b1dd74692b3a36b1701b7c9a1d69f1a13558) Update test262 commit, as old commit broke for some reason
- [`f216a7b`](https://github.com/babel/babel/commit/f216a7b06f36e6ab38c1456dbe84ff632ae17f6d) [flow] Add support for parsing `_` as implicit instantiation in call/new ([#8883](https://github-redirect.dependabot.com/babel/babel/issues/8883))
- [`c6d2f45`](https://github.com/babel/babel/commit/c6d2f45cab257acbe9f1bea25d1ce60b8971f036) Resolve babel.config.js 'babelrcRoots' values relative to the config file. (#...
- [`1d4d760`](https://github.com/babel/babel/commit/1d4d760ffc37e228814c06a482b6dcd87b44006b) Update test262 to latest commit and enable mapping for features
- Additional commits viewable in [compare view](https://github.com/babel/babel/compare/v7.1.2...v7.1.5)
</details>
<br />

[![Dependabot compatibility score](https://api.dependabot.com/badges/compatibility_score?dependency-name=@babel/cli&package-manager=npm_and_yarn&previous-version=7.1.2&new-version=7.1.5)](https://dependabot.com/compatibility-score.html?dependency-name=@babel/cli&package-manager=npm_and_yarn&previous-version=7.1.2&new-version=7.1.5)

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`.

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot ignore this [patch|minor|major] version` will close this PR and stop Dependabot creating any more for this minor/major version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
- `@dependabot use these labels` will set the current labels as the default for future PRs for this repo and language
- `@dependabot use these reviewers` will set the current reviewers as the default for future PRs for this repo and language
- `@dependabot use these assignees` will set the current assignees as the default for future PRs for this repo and language
- `@dependabot use this milestone` will set the current milestone as the default for future PRs for this repo and language
- `@dependabot badge me` will comment on this PR with code to add a "Dependabot enabled" badge to your readme

Additionally, you can set the following in your Dependabot [dashboard](https://app.dependabot.com):
- Update frequency (including time of day and day of week)
- Automerge options (never/patch/minor, and dev/runtime dependencies)
- Pull request limits (per update run and/or open at any time)
- Out-of-range updates (receive only lockfile updates, if desired)
- Security updates (receive only security updates, if desired)

Finally, you can contact us by mentioning @dependabot.

</details>

coveralls: 
[![Coverage Status](https://coveralls.io/builds/19956848/badge)](https://coveralls.io/builds/19956848)

Coverage remained the same at 44.183% when pulling **fed431788cf8e4fb80e0c3d0b1f741d50ded920d on dependabot/npm_and_yarn/@babel/cli-7.1.5** into **5473a7acacd4354dc7b550ba8e2d86d65b916c55 on master**.


Patch:
diff --git a/app/classifier/drawing-tools/components/Fan/fan.spec.jsx b/app/classifier/drawing-tools/components/Fan/fan.spec.jsx
index 102e1f20..270f09f2 100644
--- a/app/classifier/drawing-tools/components/Fan/fan.spec.jsx
+++ b/app/classifier/drawing-tools/components/Fan/fan.spec.jsx
@@ -122,7 +122,7 @@ describe('Fan Tool', function () {
     });
 
     describe('the spread drag handles', function () {
-        
+
       afterEach(function () {
         onChange.resetHistory();
       });
@@ -179,4 +179,4 @@ describe('Fan Tool', function () {
       });
     });
   });
-});
\ No newline at end of file
+});
diff --git a/package-lock.json b/package-lock.json
index e73183db..9465c378 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -4,9 +4,9 @@
   "lockfileVersion": 1,
   "dependencies": {
     "@babel/cli": {
-      "version": "7.1.2",
-      "resolved": "https://registry.npmjs.org/@babel/cli/-/cli-7.1.2.tgz",
-      "integrity": "sha1-/ChTrpaCSzd5yoXeT9Alzjz2Kl4=",
+      "version": "7.1.5",
+      "resolved": "https://registry.npmjs.org/@babel/cli/-/cli-7.1.5.tgz",
+      "integrity": "sha512-zbO/DtTnaDappBflIU3zYEgATLToRDmW5uN/EGH1GXaes7ydfjqmAoK++xmJIA+8HfDw7UyPZNdM8fhGhfmMhw==",
       "dev": true,
       "requires": {
         "chokidar": "^2.0.3",
@@ -24,7 +24,7 @@
         "slash": {
           "version": "2.0.0",
           "resolved": "https://registry.npmjs.org/slash/-/slash-2.0.0.tgz",
-          "integrity": "sha1-3lUoUaF1nfOo8gZTVEL17E3eq0Q=",
+          "integrity": "sha512-ZYKh3Wh2z1PpEXWr0MpSBZ0V6mZHAQfYevttO11c51CaWjGTaadiKZ+wVt1PbMlDV5qhMFslpZCemhwOK7C89A==",
           "dev": true
         }
       }
@@ -11023,7 +11023,7 @@
     "output-file-sync": {
       "version": "2.0.1",
       "resolved": "https://registry.npmjs.org/output-file-sync/-/output-file-sync-2.0.1.tgz",
-      "integrity": "sha1-9TEYKC9fVTwnmVQXkrcjpMcUMMA=",
+      "integrity": "sha512-mDho4qm7WgIXIGf4eYU1RHN2UU5tPfVYVSRwDJw0uTmj35DQUt/eNp19N7v6T3SrR0ESTEf2up2CGO73qI35zQ==",
       "dev": true,
       "requires": {
         "graceful-fs": "^4.1.11",
@@ -11086,9 +11086,9 @@
       "dev": true
     },
     "panoptes-client": {
-      "version": "2.11.2",
-      "resolved": "https://registry.npmjs.org/panoptes-client/-/panoptes-client-2.11.2.tgz",
-      "integrity": "sha512-HVNegg4L2fc/1Xmwu/+FKb0hm3+A+CCqqpaeFra7aVThjY/Cc0HgQnkoQEOJfsQnHr9DhcoatJudTKM5Xj+zIw==",
+      "version": "2.12.0",
+      "resolved": "https://registry.npmjs.org/panoptes-client/-/panoptes-client-2.12.0.tgz",
+      "integrity": "sha512-/gyXIM/FwGd6JaQQ8LDCdTRN3NdV4QuI4B+2+slYBGgEqDabAnL1pQGT2A+pVekjLOvluQJ4M29wO2FE0hRUKg==",
       "requires": {
         "json-api-client": "^4.0.0",
         "local-storage": "^1.4.2",
diff --git a/package.json b/package.json
index dce4afa4..3a6fcba0 100644
--- a/package.json
+++ b/package.json
@@ -19,7 +19,7 @@
     "mocha": "~5.2.0",
     "modal-form": "~2.7",
     "moment": "~2.22.2",
-    "panoptes-client": "~2.11.2",
+    "panoptes-client": "~2.12.0",
     "papaparse": "^4.6.1",
     "polished": "~2.3.0",
     "prop-types": "~15.6.2",
@@ -53,7 +53,7 @@
     "visible-element": "~1.0.1"
   },
   "devDependencies": {
-    "@babel/cli": "~7.1.2",
+    "@babel/cli": "~7.1.5",
     "@babel/core": "~7.1.2",
     "@babel/node": "^7.0.0",
     "@babel/plugin-proposal-class-properties": "^7.0.0",


Test patch:
diff --git a/app/classifier/drawing-tools/generic-tests.spec.js b/app/classifier/drawing-tools/generic-tests.spec.js
new file mode 100644
index 00000000..0185ba0c
--- /dev/null
+++ b/app/classifier/drawing-tools/generic-tests.spec.js
@@ -0,0 +1,132 @@
+import React from 'react';
+import { shallow } from 'enzyme';
+import { expect } from 'chai';
+import drawingTools from '../drawing-tools';
+
+const x = 200;
+const y = 400;
+const cursors = [
+  {
+    x: 300,
+    y: 400
+  },
+  {
+    x: 250,
+    y: 450
+  },
+  {
+    x: 200,
+    y: 500
+  }
+];
+
+const props = {
+  color: 'red',
+  containerRect: {
+    height: 100,
+    width: 100
+  },
+  naturalHeight: 100,
+  naturalWidth: 100,
+  preferences: {
+    preferences: {}
+  },
+  scale: {
+    horizontal: 1,
+    vertical: 1
+  },
+  task: {
+    tools: [{ offsetX: 50, offsetY: 50 }]
+  }
+};
+
+for (const toolType in drawingTools) {
+  let wrapper;
+  const TaskComponent = drawingTools[toolType];
+
+  describe(`Task  ${toolType}`, function() {
+    let mark;
+
+    before(function () {
+      mark = TaskComponent.defaultValues({ x, y }, props);
+      mark.tool = 0;
+    });
+
+    it('should make changes with initStart', function() {
+      const initialMark = Object.assign({}, mark);
+      if (TaskComponent.initStart) {
+        const initStartResult = TaskComponent.initStart(cursors[0], mark);
+        expect(initialMark).to.not.equal(mark);
+        expect(initStartResult).to.be.an('object');
+      }
+    });
+
+    it ('should make changes with initMove', function() {
+      const initialMark = Object.assign({}, mark);
+      if (TaskComponent.initMove) {
+        TaskComponent.initMove(cursors[1], mark);
+        expect(initialMark).to.not.equal(mark);
+      }
+    });
+
+    it ('should run initRelease', function() {
+      const initialMark = Object.assign({}, mark);
+      if (TaskComponent.initRelease) {
+        const initReleaseResult = TaskComponent.initRelease(cursors[2], mark);
+        expect(initialMark).to.not.equal(mark);
+        expect(initReleaseResult).to.be.an('object');
+      }
+    });
+
+    it ('should return a boolean with initValid', function() {
+      if (TaskComponent.initValid) {
+        const isValid = TaskComponent.initValid(mark, props);
+        expect(isValid).to.be.a('boolean');
+      }
+    });
+
+    it ('should run getDistance', function() {
+      if (TaskComponent.getDistance) {
+        const distance = TaskComponent.getDistance(cursors[0].x, cursors[0].y, cursors[1].x, cursors[1].y);
+        expect(Math.round(distance)).to.equal(71);
+      }
+    });
+
+    it ('should correctly calculate getAngle', function() {
+      if (TaskComponent.getAngle) {
+        const angle = TaskComponent.getAngle(cursors[0].x, cursors[0].y, cursors[1].x, cursors[1].y);
+        expect(Math.abs(angle)).to.equal(135);
+      }
+    });
+
+    it ('should successfuly check for completed mark', function() {
+      if (TaskComponent.forceComplete) {
+        TaskComponent.forceComplete(mark);
+      }
+
+      if (TaskComponent.isComplete) {
+        const isComplete = TaskComponent.isComplete(mark);
+        expect(isComplete).to.be.true;
+      }
+    });
+  });
+
+  describe('rendered component', function () {
+    const mark = TaskComponent.defaultValues({ x, y }, props);
+
+    if (TaskComponent.initStart) {
+      TaskComponent.initStart({ x, y }, mark);
+    }
+
+    before(function () {
+      wrapper = shallow(
+        <TaskComponent {...props} mark={mark} />
+      );
+    });
+
+    it('should render correctly', function () {
+      expect(wrapper).to.be.ok;
+      expect(wrapper.instance()).to.be.an.instanceof(TaskComponent);
+    });
+  });
+}