preview.js 1.1 KB

12345678910111213141516171819202122232425262728293031323334
  1. import assert from 'assert';
  2. import React from 'react'; // jshint ignore:line
  3. import ListPreview from 'misago/components/threads-list/list/preview'; // jshint ignore:line
  4. import * as testUtils from 'misago/utils/test-utils';
  5. describe("Threads List Preview", function() {
  6. afterEach(function() {
  7. testUtils.unmountComponents();
  8. });
  9. it("renders", function(done) {
  10. /* jshint ignore:start */
  11. testUtils.render(<ListPreview />);
  12. /* jshint ignore:end */
  13. testUtils.onElement('#test-mount .threads-list.ui-preview', function() {
  14. assert.ok(true, "component renders");
  15. assert.equal($('#test-mount .list-group-item').length, 3,
  16. "threads list preview renders with three thread previews");
  17. assert.ok(!$('#test-mount .list-group-item').eq(0).hasClass('hidden-xs'),
  18. "first row is always displayed");
  19. assert.ok($('#test-mount .list-group-item').eq(1).hasClass('hidden-xs'),
  20. "second row is hidden on mobile");
  21. assert.ok($('#test-mount .list-group-item').eq(2).hasClass('hidden-xs'),
  22. "third row is hidden on mobile");
  23. done();
  24. });
  25. });
  26. });