<commit_before>import { moduleForModel, test } from 'ember-qunit';

moduleForModel('preview', 'Unit | Model | preview', {
  // Specify the other units that are required for this test.
  needs: ['model:user', 'model:preview-user-mention']
});

test('it exists', function(assert) {
  let model = this.subject();
  // let store = this.store();
  assert.ok(!!model);
});<commit_msg>update preview unit model tests (#543)<commit_after>import { moduleForModel, test } from 'ember-qunit';
import Ember from 'ember';

const {
  get,
} = Ember;

moduleForModel('preview', 'Unit | Model | preview', {
  // Specify the other units that are required for this test.
  needs: ['model:user', 'model:preview-user-mention']
});

test('it exists', function(assert) {
  let model = this.subject();
  // let store = this.store();
  assert.ok(!!model);
});

test('should belong to a user', function(assert) {
  assert.expect(2);

  const preview = this.store().modelFor('preview');
  const relationship = get(preview, 'relationshipsByName').get('user');

  assert.equal(relationship.key, 'user', 'has relationship with user');
  assert.equal(relationship.kind, 'belongsTo', 'kind of relationship is belongsTo');
});

test('should have many preview-user-mention', function(assert) {
  assert.expect(2);

  const preview = this.store().modelFor('preview');
  const relationship = get(preview, 'relationshipsByName').get('previewUserMentions');

  assert.equal(relationship.key, 'previewUserMentions', 'has relationship with preview-user-mention');
  assert.equal(relationship.kind, 'hasMany', 'kind of relationship is hasMany');
});
{'fraction_non_alphanumeric': 0.163455562461156, 'fraction_numerical': 0.003107520198881293, 'mean_word_length': 5.24031007751938, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2743649', 'n_tokens_mistral': 491, 'n_tokens_neox': 478, 'n_words': 129}