Github user robertkowalski commented on a diff in the pull request:
https://github.com/apache/couchdb-fauxton/pull/544#discussion_r41140110
--- Diff: app/addons/fauxton/tests/componentsSpec.react.jsx ---
@@ -204,5 +207,169 @@ define([
});
-});
+ describe('Clipboard', function () {
+ var container;
+ beforeEach(function () {
+ container = document.createElement('div');
+ });
+
+ afterEach(function () {
+ React.unmountComponentAtNode(container);
+ });
+
+ it('shows a clipboard icon by default', function () {
+ var clipboard = React.render(<Views.Clipboard text="copy me" />,
container);
+
assert.equal($(clipboard.getDOMNode()).find('.fonticon-clipboard').length, 1);
+ });
+
+ it('shows text if specified', function () {
+ var clipboard = React.render(<Views.Clipboard displayType="text"
text="copy me" />, container);
+
assert.equal($(clipboard.getDOMNode()).find('.fonticon-clipboard').length, 0);
+ });
+
+ it('shows custom text if specified ', function () {
+ var clipboard = React.render(<Views.Clipboard displayType="text"
textDisplay='booyah!' text="copy me" />, container);
+ assert.ok(/booyah!/.test($(clipboard.getDOMNode())[0].outerHTML));
+ });
+
+ });
+
+
+ describe('NotificationRow', function () {
+ var container;
+
+ var notifications = {
+ success: {
+ notificationId: 1,
+ type: 'success',
+ msg: 'Success!',
+ time: moment()
+ },
+ info: {
+ notificationId: 2,
+ type: 'info',
+ msg: 'Error!',
+ time: moment()
+ },
+ error: {
+ notificationId: 3,
+ type: 'error',
+ msg: 'Error!',
+ time: moment()
+ }
+ };
+
+ beforeEach(function () {
+ container = document.createElement('div');
+ });
+
+ afterEach(function () {
+ React.unmountComponentAtNode(container);
+ });
+
+ it('shows all notification types when "all" filter applied', function
() {
+ var row1 = React.render(
--- End diff --
this all should use `TestUtils.renderIntoDocument` i guess?
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---