diff --git a/src/reps/window.js b/src/reps/window.js index 141afac..ce206f6 100644 --- a/src/reps/window.js +++ b/src/reps/window.js @@ -24,11 +24,10 @@ let Window = React.createClass({ mode: React.PropTypes.oneOf(Object.keys(MODE).map(key => MODE[key])), object: React.PropTypes.object.isRequired, objectLink: React.PropTypes.func, - title: React.PropTypes.string, }, getTitle: function (object) { - let title = this.props.title || object.class || "Window"; + let title = object.displayClass || object.class || "Window"; if (this.props.objectLink) { return DOM.span({className: "objectBox"}, this.props.objectLink({ diff --git a/src/test/mochitest/test_reps_window.html b/src/test/mochitest/test_reps_window.html index 619ad48..e5248fb 100644 --- a/src/test/mochitest/test_reps_window.html +++ b/src/test/mochitest/test_reps_window.html @@ -63,21 +63,20 @@ is(longRenderedComponent.textContent, "Window about:newtab", "Window rep has expected text content in LONG mode"); - const customTitleRenderedComponent = renderComponent(Window.rep, { - object: gripStub, + const displayClassRenderedComponent = renderComponent(Window.rep, { + object: Object.assign({}, gripStub, {displayClass : "Custom"}), mode: MODE.TINY, - title: "Custom" }); - is(customTitleRenderedComponent.textContent, "Custom", - "Window rep has expected text content in TINY mode with Custom title"); + is(displayClassRenderedComponent.textContent, "Custom", + "Window rep has expected text content in TINY mode with Custom display class"); - const customTitleLongRenderedComponent = renderComponent(Window.rep, { - object: gripStub, + const displayClassLongRenderedComponent = renderComponent(Window.rep, { + object: Object.assign({}, gripStub, {displayClass : "Custom"}), mode: MODE.LONG, title: "Custom" }); - is(customTitleLongRenderedComponent.textContent, "Custom about:newtab", - "Window rep has expected text content in LONG mode with Custom title"); + is(displayClassLongRenderedComponent.textContent, "Custom about:newtab", + "Window rep has expected text content in LONG mode with Custom display class"); } catch(e) { ok(false, "Got an error: " + DevToolsUtils.safeErrorString(e)); } finally {