<commit_before>it('works', () => {
  expect(true);
});<commit_msg>added test for create() method<commit_after>import firebase from 'firebase'
import Qwest from '../'

afterEach(() => {
  firebase.__resetAuthUserId()
  firebase.__clearMockDatabase()
})

it('successfully creates a Qwest', () => {
  // Get authorized User ID
  const currentAuthUserId = firebase.__getAuthUserId()

  // Create Qwest object and save
  const newQwest = new Qwest({
    title: 'New Qwest'
  })

  newQwest.create()

  // Get resulting database
  const database = firebase.__getMockDatabase()

  // Expect that the approriate Qwests have been created/ updated
  expect(Object.keys(database['qwests'])).toHaveLength(1)
  expect(database['qwests']['mockId1'].title).toBe(newQwest.title)
  expect(database['qwests']['mockId1'].createdBy).toBe(currentAuthUserId)

  // Expect that the approriate User Qwests have been created/ updated
  expect(Object.keys(database['user-qwests'])).toHaveLength(1)
  expect(Object.keys(database['user-qwests'][currentAuthUserId])).toHaveLength(1)
  expect(Object.keys(database['user-qwests'][currentAuthUserId]['active'])).toHaveLength(1)
  expect(database['user-qwests'][currentAuthUserId]['active']['mockId1'].title).toBe(newQwest.title)
})
{'fraction_non_alphanumeric': 0.15692554043234588, 'fraction_numerical': 0.005604483586869495, 'mean_word_length': 5.830601092896175, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 6, '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': '3611667', 'n_tokens_mistral': 393, 'n_tokens_neox': 397, 'n_words': 72}