import { skip } from 'ember-qunit';
import moduleForModel from 'web-client/tests/helpers/module-for-model';
import run from 'ember-runloop';
// import { generateAlgoliaResponse } from 'web-client/mirage/fixtures/algolia'; // TODO: this fixture doesn't exist?

moduleForModel('search', 'Integration | Models | search', {
  integration: true,
  beforeEach() {
    this.algoliaResponse = undefined; //generateAlgoliaResponse();
  }
});

skip('serializing an algolia payload', function(assert) {
  assert.expect(2);

  return run(() => {
    return this.store().pushPayload('video', this.algoliaResponse);
  }).then((search) => {
    assert.ok(search, 'should create a search model');

    return search.get('videos');
  }).then((videos) => {
    assert.equal(videos.length, 10, 'should build video relationships');
  });
});
