From 4092593b7a5387d8026c8d72904d5cca90c1cef2 Mon Sep 17 00:00:00 2001 From: panwrona Date: Thu, 12 Sep 2019 16:13:51 +0200 Subject: [PATCH 1/2] Change unit tests to get component from magic-script-components library --- package.json | 4 +++- src/__tests__/Audio.spec.js | 4 ++-- src/__tests__/Button.spec.js | 4 ++-- src/__tests__/CircleConfirmation.spec.js | 3 ++- src/__tests__/ColorPicker.spec.js | 3 ++- src/__tests__/DatePicker.spec.js | 6 +++--- src/__tests__/Image.spec.js | 4 ++-- src/__tests__/ListView.spec.js | 3 ++- src/__tests__/ListViewItem.spec.js | 3 ++- src/__tests__/Model.spec.js | 4 ++-- src/__tests__/PageView.spec.js | 4 ++-- src/__tests__/ScrollBar.spec.js | 4 ++-- src/__tests__/Text.spec.js | 4 ++-- src/__tests__/TextEdit.spec.js | 4 ++-- src/__tests__/TimePicker.spec.js | 4 ++-- src/__tests__/Video.spec.js | 4 ++-- 16 files changed, 34 insertions(+), 28 deletions(-) diff --git a/package.json b/package.json index a69d143..64bfeeb 100644 --- a/package.json +++ b/package.json @@ -32,15 +32,17 @@ }, "peerDependencies": { "@babel/core": "^7.6.0", - "@babel/plugin-transform-react-jsx": "^7.3.0", "@babel/plugin-proposal-class-properties": "^7.5.5", + "@babel/plugin-transform-react-jsx": "^7.3.0", "rollup-plugin-babel": "^4.3.3" }, "devDependencies": { + "@babel/core": "^7.6.0", "@babel/preset-env": "^7.6.0", "@babel/preset-react": "^7.0.0", "babel-jest": "^24.9.0", "jest": "^24.9.0", + "magic-script-components": "2.0.0", "react-test-renderer": "^16.9.0" } } diff --git a/src/__tests__/Audio.spec.js b/src/__tests__/Audio.spec.js index d0398a1..656bd68 100644 --- a/src/__tests__/Audio.spec.js +++ b/src/__tests__/Audio.spec.js @@ -1,11 +1,11 @@ // import React from "react"; import { create } from "react-test-renderer"; +import { Audio } from "magic-script-components"; describe("Audio component", () => { test("Matches the snapshot", () => { - const props = {fileName: "test_file.avi"}; - const audio = create(React.createElement("audio", props)); + const audio = create(