Skip to content
This repository has been archived by the owner on Sep 21, 2021. It is now read-only.

Commit

Permalink
Update stubs and add tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
Loirooriol authored and nchevobbe committed Jan 4, 2018
1 parent 37c868c commit c291a1b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/devtools-reps/src/reps/stubs/symbol.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,13 @@
const stubs = new Map();
stubs.set("Symbol", {
type: "symbol",
actor: "server1.conn1.child1/symbol1",
name: "foo"
});

stubs.set("SymbolWithoutIdentifier", {
type: "symbol"
type: "symbol",
actor: "server1.conn1.child1/symbol2",
});

module.exports = stubs;
3 changes: 3 additions & 0 deletions packages/devtools-reps/src/reps/tests/symbol.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ const { shallow } = require("enzyme");
const { REPS } = require("../rep");
const { Rep } = REPS;
const stubs = require("../stubs/symbol");
const { expectActorAttribute } = require("./test-helpers");

describe("test Symbol", () => {
const stub = stubs.get("Symbol");
Expand All @@ -16,6 +17,7 @@ describe("test Symbol", () => {
}));

expect(renderedComponent.text()).toEqual("Symbol(foo)");
expectActorAttribute(renderedComponent, stub.actor);
});
});

Expand All @@ -28,5 +30,6 @@ describe("test Symbol without identifier", () => {
}));

expect(renderedComponent.text()).toEqual("Symbol()");
expectActorAttribute(renderedComponent, stub.actor);
});
});

0 comments on commit c291a1b

Please sign in to comment.