Rafał Pitoń 9 лет назад
Родитель
Сommit
918d3576d1

+ 8 - 2
frontend/src/utils/test-utils.js

@@ -3,8 +3,14 @@ import ReactDOM from 'react-dom';
 import ReactTestUtils from 'react-addons-test-utils';
 
 // clean test mounts from components
-export function render(Component, containerId) {
-  return ReactDOM.render(Component, document.getElementById(containerId));
+export function render(containerOrComponent, Component) {
+  if (Component) {
+    return ReactDOM.render(
+      Component, document.getElementById(containerOrComponent + '-mount'));
+  } else {
+    return ReactDOM.render(
+      containerOrComponent, document.getElementById('test-mount'));
+  }
 }
 
 export function emptyTestContainers() {

+ 2 - 4
frontend/tests/captcha.js

@@ -146,8 +146,7 @@ describe("QACaptcha", function() {
               }
             }
           })}
-        </div>,
-        'test-mount'
+        </div>
       );
       /* jshint ignore:end */
 
@@ -241,8 +240,7 @@ describe("ReCaptcha", function() {
               }
             }
           })}
-        </div>,
-        'test-mount'
+        </div>
       );
       /* jshint ignore:end */
 

+ 3 - 5
frontend/tests/components/auth-message.js

@@ -10,7 +10,7 @@ describe("Auth Message", function() {
 
   it('renders stateless', function() {
     /* jshint ignore:start */
-    testUtils.render(<AuthMessage />, 'test-mount');
+    testUtils.render(<AuthMessage />);
     /* jshint ignore:end */
 
     let element = $('#test-mount .auth-message');
@@ -23,8 +23,7 @@ describe("Auth Message", function() {
     testUtils.render(
       <AuthMessage user={{username: 'Boberson'}}
                    signedOut={true}
-                   signedIn={false} />,
-      'test-mount'
+                   signedIn={false} />
     );
     /* jshint ignore:end */
 
@@ -38,8 +37,7 @@ describe("Auth Message", function() {
     testUtils.render(
       <AuthMessage user={null}
                    signedOut={false}
-                   signedIn={{username: 'Boberson'}} />,
-      'test-mount'
+                   signedIn={{username: 'Boberson'}} />
     );
     /* jshint ignore:end */
 

+ 4 - 3
frontend/tests/components/avatar.js

@@ -10,12 +10,13 @@ describe("Avatar", function() {
 
   it('renders guest avatar', function() {
     /* jshint ignore:start */
-    testUtils.render(<Avatar size="42" />, 'test-mount');
+    testUtils.render(<Avatar size="42" />);
     /* jshint ignore:end */
 
     let element = $('#test-mount img.user-avatar');
     assert.ok(element.length, "component renders for guest");
-    assert.equal(element.attr('src'), '/test-runner/user-avatar/42.png', "component builds valid avatar url");
+    assert.equal(element.attr('src'), '/test-runner/user-avatar/42.png',
+      "component builds valid avatar url");
   });
 
   it('renders user avatar', function() {
@@ -25,7 +26,7 @@ describe("Avatar", function() {
       avatar_hash: 'aabbccddeeff'
     };
 
-    testUtils.render(<Avatar user={user} size="42" />, 'test-mount');
+    testUtils.render(<Avatar user={user} size="42" />);
     /* jshint ignore:end */
 
     let element = $('#test-mount img.user-avatar');

+ 5 - 10
frontend/tests/components/banned-page.js

@@ -12,8 +12,7 @@ describe("Banned page", function() {
   it('renders', function() {
     /* jshint ignore:start */
     testUtils.render(
-      <BannedPage message={{html: '<p>Lorem ipsum!</p>'}} expires={null} />,
-      'test-mount'
+      <BannedPage message={{html: '<p>Lorem ipsum!</p>'}} expires={null} />
     );
     /* jshint ignore:end */
 
@@ -26,8 +25,7 @@ describe("Banned page", function() {
   it('renders with fallback message', function() {
     /* jshint ignore:start */
     testUtils.render(
-      <BannedPage message={{plain: 'Lorem ipsum plain!'}} expires={null} />,
-      'test-mount'
+      <BannedPage message={{plain: 'Lorem ipsum plain!'}} expires={null} />
     );
     /* jshint ignore:end */
 
@@ -40,8 +38,7 @@ describe("Banned page", function() {
   it('renders with permanent expiration date', function() {
     /* jshint ignore:start */
     testUtils.render(
-      <BannedPage message={{plain: 'Lorem ipsum plain!'}} expires={null} />,
-      'test-mount'
+      <BannedPage message={{plain: 'Lorem ipsum plain!'}} expires={null} />
     );
     /* jshint ignore:end */
 
@@ -55,8 +52,7 @@ describe("Banned page", function() {
     /* jshint ignore:start */
     let expires = moment().add(7, 'days');
     testUtils.render(
-      <BannedPage message={{plain: 'Lorem ipsum plain!'}} expires={expires} />,
-      'test-mount'
+      <BannedPage message={{plain: 'Lorem ipsum plain!'}} expires={expires} />
     );
     /* jshint ignore:end */
 
@@ -70,8 +66,7 @@ describe("Banned page", function() {
     /* jshint ignore:start */
     let expires = moment().subtract(7, 'days');
     testUtils.render(
-      <BannedPage message={{plain: 'Lorem ipsum plain!'}} expires={expires} />,
-      'test-mount'
+      <BannedPage message={{plain: 'Lorem ipsum plain!'}} expires={expires} />
     );
     /* jshint ignore:end */
 

+ 8 - 6
frontend/tests/components/button.js

@@ -10,13 +10,14 @@ describe("Button", function() {
 
   it('renders', function() {
     /* jshint ignore:start */
-    testUtils.render(<Button>Lorem ipsum</Button>, 'test-mount');
+    testUtils.render(<Button>Lorem ipsum</Button>);
     /* jshint ignore:end */
 
     let element = $('#test-mount button');
     assert.ok(element.length, "component rendered");
     assert.equal(element.attr('type'), 'submit', "component is submit button");
-    assert.equal(element.text().trim(), "Lorem ipsum", "component contains child");
+    assert.equal(element.text().trim(), "Lorem ipsum",
+      "component contains child");
   });
 
   it('handles clicks', function(done) { // jshint ignore:line
@@ -26,7 +27,7 @@ describe("Button", function() {
       done();
     }
 
-    testUtils.render(<Button onClick={click}>Lorem ipsum</Button>, 'test-mount');
+    testUtils.render(<Button onClick={click}>Lorem ipsum</Button>);
     /* jshint ignore:end */
 
     let element = $('#test-mount button');
@@ -37,7 +38,7 @@ describe("Button", function() {
 
   it('renders disabled', function() {
     /* jshint ignore:start */
-    testUtils.render(<Button disabled={true}>Lorem ipsum</Button>, 'test-mount');
+    testUtils.render(<Button disabled={true}>Lorem ipsum</Button>);
     /* jshint ignore:end */
 
     let element = $('#test-mount button');
@@ -47,11 +48,12 @@ describe("Button", function() {
 
   it('renders loading', function() {
     /* jshint ignore:start */
-    testUtils.render(<Button loading={true}>Lorem ipsum</Button>, 'test-mount');
+    testUtils.render(<Button loading={true}>Lorem ipsum</Button>);
     /* jshint ignore:end */
 
     let element = $('#test-mount button>.loader');
     assert.ok(element.length, "component rendered with loader");
-    assert.equal(element.parent().attr('disabled'), 'disabled', "component is disabled");
+    assert.equal(element.parent().attr('disabled'), 'disabled',
+      "component is disabled");
   });
 });

+ 6 - 12
frontend/tests/components/form-group.js

@@ -14,8 +14,7 @@ describe("Form Group", function() {
       <FormGroup label="Lorem Ipsum"
                  for="test_input">
         <input name="lorem" type="text" />
-      </FormGroup>,
-      'test-mount'
+      </FormGroup>
     );
     /* jshint ignore:end */
 
@@ -39,8 +38,7 @@ describe("Form Group", function() {
                  controlClass="test-control"
                  for="test_input">
         <input name="lorem" type="text" />
-      </FormGroup>,
-      'test-mount'
+      </FormGroup>
     );
     /* jshint ignore:end */
 
@@ -60,8 +58,7 @@ describe("Form Group", function() {
                  for="test_input"
                  validation={null}>
         <input name="lorem" type="text" />
-      </FormGroup>,
-      'test-mount'
+      </FormGroup>
     );
     /* jshint ignore:end */
 
@@ -84,8 +81,7 @@ describe("Form Group", function() {
                  for="test_input"
                  validation={["First issue.", "Second issue."]}>
         <input name="lorem" type="text" />
-      </FormGroup>,
-      'test-mount'
+      </FormGroup>
     );
     /* jshint ignore:end */
 
@@ -119,8 +115,7 @@ describe("Form Group", function() {
                  for="test_input"
                  helpText="Lorem ipsum dolor met.">
         <input name="lorem" type="text" />
-      </FormGroup>,
-      'test-mount'
+      </FormGroup>
     );
     /* jshint ignore:end */
 
@@ -139,8 +134,7 @@ describe("Form Group", function() {
                  for="test_input"
                  extra={<p id="row-extra">Extra!!!</p>}>
         <input name="lorem" type="text" />
-      </FormGroup>,
-      'test-mount'
+      </FormGroup>
     );
     /* jshint ignore:end */
 

+ 1 - 1
frontend/tests/components/form.js

@@ -39,7 +39,7 @@ class TestForm extends Form { // jshint ignore:line
 describe("Form", function() {
   beforeEach(function() {
     /* jshint ignore:start */
-    form = testUtils.render(<TestForm />, 'test-mount');
+    form = testUtils.render(<TestForm />);
     /* jshint ignore:end */
   });
 

+ 1 - 1
frontend/tests/components/loader.js

@@ -10,7 +10,7 @@ describe("Loader", function() {
 
   it('renders', function() {
     /* jshint ignore:start */
-    testUtils.render(<Loader />, 'test-mount');
+    testUtils.render(<Loader />);
     /* jshint ignore:end */
 
     assert.ok($('#test-mount .loader .loader-spinning-wheel').length,

+ 5 - 10
frontend/tests/components/password-strength.js

@@ -30,8 +30,7 @@ describe("Password Strength", function() {
 
     /* jshint ignore:start */
     testUtils.render(
-      <PasswordStrength password="very-weak" inputs={['a', 'b', 'c']} />,
-      'test-mount'
+      <PasswordStrength password="very-weak" inputs={['a', 'b', 'c']} />
     );
     /* jshint ignore:end */
 
@@ -72,8 +71,7 @@ describe("Password Strength", function() {
 
     /* jshint ignore:start */
     testUtils.render(
-      <PasswordStrength password="weak" inputs={['a', 'b', 'c']} />,
-      'test-mount'
+      <PasswordStrength password="weak" inputs={['a', 'b', 'c']} />
     );
     /* jshint ignore:end */
 
@@ -114,8 +112,7 @@ describe("Password Strength", function() {
 
     /* jshint ignore:start */
     testUtils.render(
-      <PasswordStrength password="average" inputs={['a', 'b', 'c']} />,
-      'test-mount'
+      <PasswordStrength password="average" inputs={['a', 'b', 'c']} />
     );
     /* jshint ignore:end */
 
@@ -156,8 +153,7 @@ describe("Password Strength", function() {
 
     /* jshint ignore:start */
     testUtils.render(
-      <PasswordStrength password="stronk" inputs={['a', 'b', 'c']} />,
-      'test-mount'
+      <PasswordStrength password="stronk" inputs={['a', 'b', 'c']} />
     );
     /* jshint ignore:end */
 
@@ -198,8 +194,7 @@ describe("Password Strength", function() {
 
     /* jshint ignore:start */
     testUtils.render(
-      <PasswordStrength password="very-stronk" inputs={['a', 'b', 'c']} />,
-      'test-mount'
+      <PasswordStrength password="very-stronk" inputs={['a', 'b', 'c']} />
     );
     /* jshint ignore:end */
 

+ 1 - 1
frontend/tests/components/register-button.js

@@ -18,7 +18,7 @@ describe("RegisterButton", function() {
     testUtils.contextClear(misago);
 
     /* jshint ignore:start */
-    testUtils.render(<RegisterButton />, 'test-mount');
+    testUtils.render(<RegisterButton />);
     /* jshint ignore:end */
   });
 

+ 4 - 12
frontend/tests/components/register.js

@@ -36,10 +36,7 @@ describe("Register Form", function() {
     };
 
     /* jshint ignore:start */
-    component = testUtils.render(
-      <RegisterForm />,
-      'test-mount'
-    );
+    component = testUtils.render(<RegisterForm />);
     /* jshint ignore:end */
   });
 
@@ -188,10 +185,7 @@ describe("Register Form", function() {
       done();
     };
 
-    component = testUtils.render(
-      <RegisterForm callback={callback}/>,
-      'test-mount'
-    );
+    component = testUtils.render(<RegisterForm callback={callback}/>);
     /* jshint ignore:end */
 
     $.mockjax({
@@ -222,8 +216,7 @@ describe("Register Complete", function() {
     testUtils.render(
       <RegisterComplete activation="user"
                         username="Bob"
-                        email="bob@boberson.com" />,
-      'test-mount'
+                        email="bob@boberson.com" />
     );
     /* jshint ignore:end */
 
@@ -244,8 +237,7 @@ describe("Register Complete", function() {
     testUtils.render(
       <RegisterComplete activation="admin"
                         username="Bob"
-                        email="bob@boberson.com" />,
-      'test-mount'
+                        email="bob@boberson.com" />
     );
     /* jshint ignore:end */
 

+ 0 - 213
frontend/tests/components/request-actiavtion-link.js

@@ -1,213 +0,0 @@
-import assert from 'assert';
-import React from 'react'; // jshint ignore:line
-import ReactDOM from 'react-dom'; // jshint ignore:line
-import misago from 'misago/index';
-import { RequestLinkForm, LinkSent } from 'misago/components/request-activation-link'; // jshint ignore:line
-import snackbar from 'misago/services/snackbar';
-
-let snackbarStore = null;
-
-describe("Request Activation Link Form", function() {
-  beforeEach(function() {
-    snackbarStore = window.snackbarStoreMock();
-    snackbar.init(snackbarStore);
-
-    misago._context = {
-      'SETTINGS': {
-        'forum_name': 'Test forum'
-      },
-      'SEND_ACTIVATION_API': '/test-api/send-activation/'
-    };
-
-    /* jshint ignore:start */
-    ReactDOM.render(
-      <RequestLinkForm />,
-      document.getElementById('test-mount')
-    );
-    /* jshint ignore:end */
-  });
-
-  afterEach(function() {
-    window.emptyTestContainers();
-    window.snackbarClear(snackbar);
-    $.mockjax.clear();
-  });
-
-  it("renders", function() {
-    let element = $('#test-mount .well-form-request-activation-link');
-    assert.ok(element.length, "component renders");
-  });
-
-  it("handles empty submit", function(done) {
-    snackbarStore.callback(function(message) {
-      assert.deepEqual(message, {
-        message: "Enter a valid email address.",
-        type: 'error'
-      }, "form brought error about no input");
-      done();
-    });
-
-    window.simulateSubmit('#test-mount form');
-  });
-
-  it("handles invalid submit", function(done) {
-    snackbarStore.callback(function(message) {
-      assert.deepEqual(message, {
-        message: "Enter a valid email address.",
-        type: 'error'
-      }, "form brought error about invalid input");
-      done();
-    });
-
-    window.simulateChange('#test-mount input', 'loremipsum');
-    window.simulateSubmit('#test-mount form');
-  });
-
-  it("handles backend error", function(done) {
-    snackbarStore.callback(function(message) {
-      assert.deepEqual(message, {
-        message: "Unknown error has occured.",
-        type: 'error'
-      }, "form raised alert about backend error");
-      done();
-    });
-
-    $.mockjax({
-      url: '/test-api/send-activation/',
-      status: 500
-    });
-
-    window.simulateChange('#test-mount input', 'lorem@ipsum.com');
-    window.simulateSubmit('#test-mount form');
-  });
-
-  it("handles backend rejection", function(done) {
-    snackbarStore.callback(function(message) {
-      assert.deepEqual(message, {
-        message: "Nope nope nope!",
-        type: 'error'
-      }, "form raised alert about backend rejection");
-      done();
-    });
-
-    $.mockjax({
-      url: '/test-api/send-activation/',
-      status: 400,
-      responseText: {
-        detail: "Nope nope nope!"
-      }
-    });
-
-    window.simulateChange('#test-mount input', 'lorem@ipsum.com');
-    window.simulateSubmit('#test-mount form');
-  });
-
-  it("handles backend info", function(done) {
-    snackbarStore.callback(function(message) {
-      assert.deepEqual(message, {
-        message: "Your account is already active!",
-        type: 'info'
-      }, "form raised alert about backend info");
-      done();
-    });
-
-    $.mockjax({
-      url: '/test-api/send-activation/',
-      status: 400,
-      responseText: {
-        code: 'already_active',
-        detail: "Your account is already active!"
-      }
-    });
-
-    window.simulateChange('#test-mount input', 'lorem@ipsum.com');
-    window.simulateSubmit('#test-mount form');
-  });
-
-  it("from banned IP", function(done) {
-    $.mockjax({
-      url: '/test-api/send-activation/',
-      status: 403,
-      responseText: {
-        'ban': {
-          'expires_on': null,
-          'message': {
-            'plain': 'Your ip is banned for spamming.',
-            'html': '<p>Your ip is banned for spamming.</p>',
-          }
-        }
-      }
-    });
-
-    window.simulateChange('#test-mount input', 'lorem@ipsum.com');
-    window.simulateSubmit('#test-mount form');
-
-    window.onElement('.page-error-banned .lead', function() {
-      assert.equal(
-        $('.page .message-body .lead p').text().trim(),
-        "Your ip is banned for spamming.",
-        "displayed error banned page with ban message.");
-
-      done();
-    });
-  });
-
-  it("handles success", function(done) { // jshint ignore:line
-    $.mockjax({
-      url: '/test-api/send-activation/',
-      status: 200,
-      responseText: {
-        'username': 'Bob',
-        'email': 'bob@boberson.com'
-      }
-    });
-
-    /* jshint ignore:start */
-    let callback = function(apiResponse) {
-      assert.deepEqual(apiResponse, {
-        'username': 'Bob',
-        'email': 'bob@boberson.com'
-      }, "callback function was called on ajax success");
-      done();
-    };
-
-    ReactDOM.render(
-      <RequestLinkForm callback={callback} />,
-      document.getElementById('test-mount')
-    );
-    /* jshint ignore:end */
-
-    window.simulateChange('#test-mount input', 'lorem@ipsum.com');
-    window.simulateSubmit('#test-mount form');
-  });
-});
-
-describe("Activation Link Sent", function() {
-  afterEach(function() {
-    window.emptyTestContainers();
-  });
-
-  it("renders message", function(done) { // jshint ignore:line
-    /* jshint ignore:start */
-    let callback = function() {
-      assert.ok(true, "callback function was called on button press");
-      done();
-    };
-
-    ReactDOM.render(
-      <LinkSent user={{email: 'bob@boberson.com' }}
-                callback={callback} />,
-      document.getElementById('test-mount')
-    );
-    /* jshint ignore:end */
-
-    let element = $('#test-mount .well-done');
-    assert.ok(element.length, "component renders");
-
-    assert.equal(element.find('p').text().trim(),
-      "Activation link was sent to bob@boberson.com",
-      "component renders valid message");
-
-    window.simulateClick('#test-mount .btn-primary');
-  });
-});

+ 5 - 3
frontend/tests/components/request-activation-link.js

@@ -20,7 +20,7 @@ describe("Request Activation Link Form", function() {
     };
 
     /* jshint ignore:start */
-    testUtils.render(<RequestLinkForm />, 'test-mount');
+    testUtils.render(<RequestLinkForm />);
     /* jshint ignore:end */
   });
 
@@ -168,7 +168,7 @@ describe("Request Activation Link Form", function() {
       done();
     };
 
-    testUtils.render(<RequestLinkForm callback={callback} />, 'test-mount');
+    testUtils.render(<RequestLinkForm callback={callback} />);
     /* jshint ignore:end */
 
     testUtils.simulateChange('#test-mount input', 'lorem@ipsum.com');
@@ -188,7 +188,9 @@ describe("Activation Link Sent", function() {
       done();
     };
 
-    testUtils.render(<LinkSent user={{email: 'bob@boberson.com' }} callback={callback} />, 'test-mount');
+    testUtils.render(
+      <LinkSent user={{email: 'bob@boberson.com' }} callback={callback} />
+    );
     /* jshint ignore:end */
 
     let element = $('#test-mount .well-done');

+ 6 - 12
frontend/tests/components/request-password-reset.js

@@ -20,7 +20,7 @@ describe("Request Password Reset Form", function() {
     };
 
     /* jshint ignore:start */
-    testUtils.render(<RequestResetForm />, 'test-mount');
+    testUtils.render(<RequestResetForm />);
     /* jshint ignore:end */
   });
 
@@ -122,10 +122,7 @@ describe("Request Password Reset Form", function() {
       done();
     };
 
-    testUtils.render(
-      <RequestResetForm showInactivePage={showInactivePage}/>,
-      'test-mount'
-    );
+    testUtils.render(<RequestResetForm showInactivePage={showInactivePage} />);
     /* jshint ignore:end */
 
     testUtils.simulateChange('#test-mount input', 'lorem@ipsum.com');
@@ -179,7 +176,7 @@ describe("Request Password Reset Form", function() {
       done();
     };
 
-    testUtils.render(<RequestResetForm callback={callback} />, 'test-mount');
+    testUtils.render(<RequestResetForm callback={callback} />);
     /* jshint ignore:end */
 
     testUtils.simulateChange('#test-mount input', 'lorem@ipsum.com');
@@ -201,8 +198,7 @@ describe("Reset Link Sent", function() {
 
     testUtils.render(
       <LinkSent user={{email: 'bob@boberson.com' }}
-                callback={callback} />,
-      'test-mount'
+                callback={callback} />
     );
     /* jshint ignore:end */
 
@@ -232,8 +228,7 @@ describe("Account Inactive Page", function() {
     /* jshint ignore:start */
     testUtils.render(
       <AccountInactivePage activation='inactive_user'
-                           message="Lorem ipsum dolor met." />,
-      'test-mount'
+                           message="Lorem ipsum dolor met." />
     );
     /* jshint ignore:end */
 
@@ -253,8 +248,7 @@ describe("Account Inactive Page", function() {
     /* jshint ignore:start */
     testUtils.render(
       <AccountInactivePage activation='inactive_admin'
-                           message="Lorem ipsum dolor met admin." />,
-      'test-mount'
+                           message="Lorem ipsum dolor met admin." />
     );
     /* jshint ignore:end */
 

+ 3 - 3
frontend/tests/components/reset-password-form.js

@@ -22,7 +22,7 @@ describe("Reset Password Form", function() {
     };
 
     /* jshint ignore:start */
-    testUtils.render(<ResetPasswordForm />, 'test-mount');
+    testUtils.render(<ResetPasswordForm />);
     /* jshint ignore:end */
   });
 
@@ -146,7 +146,7 @@ describe("Reset Password Form", function() {
       done();
     };
 
-    testUtils.render(<ResetPasswordForm callback={callback} />, 'test-mount');
+    testUtils.render(<ResetPasswordForm callback={callback} />);
     /* jshint ignore:end */
 
     testUtils.simulateChange('#test-mount input', 'Som3L33tP455');
@@ -163,7 +163,7 @@ describe("Password Changed Page", function() {
     };
 
     /* jshint ignore:start */
-    testUtils.render(<PasswordChangedPage user={{username: 'BobBoberson'}} />, 'test-mount');
+    testUtils.render(<PasswordChangedPage user={{username: 'BobBoberson'}} />);
     /* jshint ignore:end */
   });
 

+ 1 - 1
frontend/tests/components/sign-in.js

@@ -25,7 +25,7 @@ describe("Sign In", function() {
     };
 
     /* jshint ignore:start */
-    testUtils.render(<SignIn />, 'test-mount');
+    testUtils.render(<SignIn />);
     /* jshint ignore:end */
   });
 

+ 5 - 12
frontend/tests/components/snackbar.js

@@ -10,10 +10,7 @@ describe("Snackbar", function() {
 
   it('renders', function() {
     /* jshint ignore:start */
-    testUtils.render(
-      <Snackbar isVisible={false} message="" type="info" />,
-      'test-mount'
-    );
+    testUtils.render(<Snackbar isVisible={false} message="" type="info" />);
     /* jshint ignore:end */
 
     assert.ok($('.alerts-snackbar').hasClass('out'), "component is hidden");
@@ -21,8 +18,7 @@ describe("Snackbar", function() {
     /* jshint ignore:start */
     testUtils.render(
       <Snackbar isVisible={true} type="success"
-                message="Lorem ipsum dolor met." />,
-      'test-mount'
+                message="Lorem ipsum dolor met." />
     );
     /* jshint ignore:end */
 
@@ -37,8 +33,7 @@ describe("Snackbar", function() {
     /* jshint ignore:start */
     testUtils.render(
       <Snackbar isVisible={true} type="info"
-                message="Lorem ipsum dolor met." />,
-      'test-mount'
+                message="Lorem ipsum dolor met." />
     );
     /* jshint ignore:end */
     assert.ok($('.alerts-snackbar p').hasClass('alert-info'),
@@ -47,8 +42,7 @@ describe("Snackbar", function() {
     /* jshint ignore:start */
     testUtils.render(
       <Snackbar isVisible={true} type="warning"
-                message="Lorem ipsum dolor met." />,
-      'test-mount'
+                message="Lorem ipsum dolor met." />
     );
     /* jshint ignore:end */
     assert.ok($('.alerts-snackbar p').hasClass('alert-warning'),
@@ -57,8 +51,7 @@ describe("Snackbar", function() {
     /* jshint ignore:start */
     testUtils.render(
       <Snackbar isVisible={true} type="error"
-                message="Lorem ipsum dolor met." />,
-      'test-mount'
+                message="Lorem ipsum dolor met." />
     );
     /* jshint ignore:end */
     assert.ok($('.alerts-snackbar p').hasClass('alert-danger'),

+ 3 - 3
frontend/tests/components/user-menu/guest-menu.js

@@ -18,7 +18,7 @@ describe("GuestMenu", function() {
     };
 
     /* jshint ignore:start */
-    testUtils.render(<GuestMenu />, 'test-mount');
+    testUtils.render(<GuestMenu />);
     /* jshint ignore:end */
   });
 
@@ -52,7 +52,7 @@ describe("GuestNav", function() {
     };
 
     /* jshint ignore:start */
-    testUtils.render(<GuestNav />, 'test-mount');
+    testUtils.render(<GuestNav />);
     /* jshint ignore:end */
   });
 
@@ -81,7 +81,7 @@ describe("CompactGuestNav", function() {
     testUtils.initDropdown(dropdown);
 
     /* jshint ignore:start */
-    testUtils.render(<CompactGuestNav />, 'test-mount');
+    testUtils.render(<CompactGuestNav />);
     /* jshint ignore:end */
   });
 

+ 3 - 6
frontend/tests/components/user-menu/user-menu.js

@@ -15,7 +15,7 @@ describe("UserMenu", function() {
     testUtils.initDropdown(dropdown);
 
     /* jshint ignore:start */
-    testUtils.render(<UserMenu user={misago._context.user} />, 'test-mount');
+    testUtils.render(<UserMenu user={misago._context.user} />);
     /* jshint ignore:end */
   });
 
@@ -38,7 +38,7 @@ describe("UserNav", function() {
     testUtils.initDropdown(dropdown);
 
     /* jshint ignore:start */
-    testUtils.render(<UserNav user={misago._context.user} />, 'test-mount');
+    testUtils.render(<UserNav user={misago._context.user} />);
     /* jshint ignore:end */
   });
 
@@ -73,10 +73,7 @@ describe("CompactUserNav", function() {
     testUtils.initDropdown(dropdown);
 
     /* jshint ignore:start */
-    testUtils.render(
-      <CompactUserNav user={misago._context.user} />,
-      'test-mount'
-    );
+    testUtils.render(<CompactUserNav user={misago._context.user} />);
     /* jshint ignore:end */
   });