import Ember from 'ember';
import { module, test, skip } from 'qunit';
import startApp from 'ttz/tests/helpers/start-app';

let application;

module('Acceptance | Index', {
  beforeEach() {
    application = startApp();
  },

  afterEach() {
    Ember.run(application, 'destroy');
  }
});

test('with no users, shows message', function(assert) {
  assert.expect(3);

  authenticateSession();

  visit('/');

  andThen(function() {
    assert.equal(currentURL(), '/');

    assert.equal(find('.user-profile').length, 0, 'shows no users');

    assert.equal(find('.cta').text().trim(), 'No users found.',
                 'shows message that no users are found');
  });
});

skip('shows a list of users grouped by timezone', function(assert) {
});

skip('distant timezones have more space between them', function(assert) {
});

skip('can search for users by name', function(assert) {
});

@@ -458,19 +458,39 @@
 L(), '/'
+, 'shows index page'
 );%0A
-
 %0A    ass
@@ -686,20 +686,20 @@
 );%0A%7D);%0A%0A
-skip
+test
 ('shows 
@@ -747,32 +747,666 @@
 ction(assert) %7B%0A
+  assert.expect(4);%0A%0A  authenticateSession();%0A%0A  let tzOffsets = %5B-25200, -25200, 3600, 7200, 7200%5D;%0A  let users = tzOffsets.map(tzo =%3E server.create('user', %7B 'tz_offset': tzo %7D));%0A%0A  visit('/');%0A%0A  andThen(function() %7B%0A    assert.equal(find('.user-profile').length, 5, 'shows 5 user profiles');%0A%0A    assert.equal(find('.timezone-group').length, 3,%0A                 'users grouped into 3 timezones');%0A%0A    assert.equal(find('.timezone-column').length, 10,%0A                 'shows 11 total timezone columns');%0A%0A    assert.equal(find('.timezone-column--empty').length, 7,%0A                 '8 of the timezone columns are empty');%0A  %7D);%0A
 %7D);%0A%0Askip('dista

Add acceptance test for showing users