import assert from 'assert'; import React from 'react'; // jshint ignore:line import ListEmpty from 'misago/components/threads-list/list/empty'; // jshint ignore:line import * as testUtils from 'misago/utils/test-utils'; describe("Empty Threads List", function() { afterEach(function() { testUtils.unmountComponents(); }); it("renders", function(done) { /* jshint ignore:start */ testUtils.render(

Well, this is empty list message!

); /* jshint ignore:end */ testUtils.onElement('#test-mount .threads-list p', function(element) { assert.ok(true, "component renders"); assert.equal($(element).text(), "Well, this is empty list message!", "empty list renders its child content as empty message"); assert.ok(!$(element).find('.threads-diff-message').length, "message about new threads is hidden"); done(); }); }); it("renders with diff message", function(done) { // jshint ignore:line /* jshint ignore:start */ const applyDiff = function() { assert.ok(true, "apply diff message runs callback"); done(); }; testUtils.render(

Well, this is empty list message!

); /* jshint ignore:end */ testUtils.onElement('#test-mount .threads-list .btn', function(element) { assert.ok(true, "component renders"); assert.equal($(element).find('.diff-message').text(), "There is 1 new or updated thread. Click this message to show it.", "message about new threads is displayed"); testUtils.simulateClick('.btn'); }); }); });