-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4 from magic-script/feature/refactor_unit_tests
Change unit tests to get components from magic-script-components library
- Loading branch information
Showing
17 changed files
with
38 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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(<Audio fileName="test_file.avi" />); | ||
expect(audio.toJSON()).toMatchSnapshot(); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
// | ||
import React from "react"; | ||
import { create } from "react-test-renderer"; | ||
import { Button } from "magic-script-components"; | ||
|
||
describe("Button component", () => { | ||
test("Matches the snapshot", () => { | ||
const props = {text: "Test Button", width: 0.25, height: 0.1} | ||
const button = create(React.createElement("button", props)); | ||
const button = create(<Button text="Test Button" width={0.25} height={0.1} />); | ||
expect(button.toJSON()).toMatchSnapshot(); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,11 @@ | ||
// | ||
import React from "react"; | ||
import { create } from "react-test-renderer"; | ||
import { CircleConfirmation } from "magic-script-components"; | ||
|
||
describe("CircleConfirmation component", () => { | ||
test("Matches the snapshot", () => { | ||
const circleConfirmation = create(React.createElement("circleConfirmation")); | ||
const circleConfirmation = create(<CircleConfirmation />); | ||
expect(circleConfirmation.toJSON()).toMatchSnapshot(); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,11 @@ | ||
// | ||
import React from "react"; | ||
import { create } from "react-test-renderer"; | ||
import { ColorPicker } from "magic-script-components"; | ||
|
||
describe("ColorPicker component", () => { | ||
test("Matches the snapshot", () => { | ||
const colorPicker = create(React.createElement("colorPicker")); | ||
const colorPicker = create(<ColorPicker />); | ||
expect(colorPicker.toJSON()).toMatchSnapshot(); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
// | ||
import React from "react"; | ||
import { create } from "react-test-renderer"; | ||
import { DatePicker } from "magic-script-components"; | ||
|
||
describe("DatePicker component", () => { | ||
test("Matches the snapshot", () => { | ||
const props = {label: "Test DatePicker"} | ||
const datepicker = create(React.createElement("datePicker", props)); | ||
expect(datepicker.toJSON()).toMatchSnapshot(); | ||
const datePicker = create(<DatePicker label="Test DatePicker" />); | ||
expect(datePicker.toJSON()).toMatchSnapshot(); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
// | ||
import React from "react"; | ||
import { create } from "react-test-renderer"; | ||
import { Image } from "magic-script-components"; | ||
|
||
describe("Image component", () => { | ||
test("Matches the snapshot", () => { | ||
const props = {filePath: "test_file.png", width: 0.2, height: 0.2} | ||
const image = create(React.createElement("image", props)); | ||
const image = create(<Image filePath="test_file.png" width={0.2} height={0.2} />); | ||
expect(image.toJSON()).toMatchSnapshot(); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,11 @@ | ||
// | ||
import React from "react"; | ||
import { create } from "react-test-renderer"; | ||
import { ListView } from "magic-script-components"; | ||
|
||
describe("ListView component", () => { | ||
test("Matches the snapshot", () => { | ||
const listView = create(React.createElement("listView")); | ||
const listView = create(<ListView />); | ||
expect(listView.toJSON()).toMatchSnapshot(); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,11 @@ | ||
// | ||
import React from "react"; | ||
import { create } from "react-test-renderer"; | ||
import { ListViewItem } from "magic-script-components"; | ||
|
||
describe("ListViewItem component", () => { | ||
test("Matches the snapshot", () => { | ||
const listViewItem = create(React.createElement("listViewItem")); | ||
const listViewItem = create(<ListViewItem />); | ||
expect(listViewItem.toJSON()).toMatchSnapshot(); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
// | ||
import React from "react"; | ||
import { create } from "react-test-renderer"; | ||
import { Model } from "magic-script-components"; | ||
|
||
describe("Model component", () => { | ||
test("Matches the snapshot", () => { | ||
const props = {modelPath:"", materialPath:"", texturePath:"", textureName:""} | ||
const model = create(React.createElement("model", props)); | ||
const model = create(<Model modelPath="" materialPath="" texturePath="" textureName="" />); | ||
expect(model.toJSON()).toMatchSnapshot(); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
// | ||
import React from "react"; | ||
import { create } from "react-test-renderer"; | ||
import { PageView } from "magic-script-components"; | ||
|
||
describe("PageView component", () => { | ||
test("Matches the snapshot", () => { | ||
const props = {width: 0.2, height: 0.2} | ||
const pageView = create(React.createElement("pageView", props)); | ||
const pageView = create(<PageView width={0.2} height={0.2} />); | ||
expect(pageView.toJSON()).toMatchSnapshot(); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
// | ||
import React from "react"; | ||
import { create } from "react-test-renderer"; | ||
import { ScrollBar } from "magic-script-components"; | ||
|
||
describe("ScrollBar component", () => { | ||
test("Matches the snapshot", () => { | ||
const props = {width: 0.1} | ||
const scrollbar = create(React.createElement("scrollBar", props)); | ||
const scrollbar = create(<ScrollBar width={0.1} />); | ||
expect(scrollbar.toJSON()).toMatchSnapshot(); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
// | ||
import React from "react"; | ||
import { create } from "react-test-renderer"; | ||
import { Text } from "magic-script-components"; | ||
|
||
describe("Text component", () => { | ||
test("Matches the snapshot", () => { | ||
const props = {text: "Test Text"} | ||
const text = create(React.createElement("text", props)); | ||
const text = create(<Text text="Test Text" />); | ||
expect(text.toJSON()).toMatchSnapshot(); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
// | ||
import React from "react"; | ||
import { create } from "react-test-renderer"; | ||
import { TextEdit } from "magic-script-components"; | ||
|
||
describe("TextEdit component", () => { | ||
test("Matches the snapshot", () => { | ||
const props = {text: "Test Text Edit", width: 0.25, height: 0.1} | ||
const text = create(React.createElement("textEdit", props)); | ||
const text = create(<TextEdit text="Test Text Edit" width={0.25} height={0.1} />); | ||
expect(text.toJSON()).toMatchSnapshot(); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
// | ||
import React from "react"; | ||
import { create } from "react-test-renderer"; | ||
import { TimePicker } from "magic-script-components"; | ||
|
||
describe("TimePicker component", () => { | ||
test("Matches the snapshot", () => { | ||
const props = {label: "Test TimePicker"} | ||
const timePicker = create(React.createElement("timePicker", props)); | ||
const timePicker = create(<TimePicker label="Test TimePicker" />); | ||
expect(timePicker.toJSON()).toMatchSnapshot(); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
// | ||
import React from "react"; | ||
import { create } from "react-test-renderer"; | ||
import { Video } from "magic-script-components"; | ||
|
||
describe("Video component", () => { | ||
test("Matches the snapshot", () => { | ||
const props = {videoPath: "test_file.mp4"} | ||
const video = create(React.createElement("video", props)); | ||
const video = create(<Video videoPath="test_file.mp4" />); | ||
expect(video.toJSON()).toMatchSnapshot(); | ||
}); | ||
}); |