Lambda-School-Labs/allay-be

View on GitHub
__tests__/companies-model_add_company.spec.js

Summary

Maintainability
A
1 hr
Test Coverage
const {createCompany, resetTable} = require('./utils/');
const db = require('../data/dbConfig');
const Company = require('../helpers/companies-model');

const company = createCompany();

describe('Models Companies', () => {
  beforeAll(async () => {
    await resetTable('companies');
  });

  describe('addCompany()', () => {
    it('Adds company', async () => {
      await Company.addCompany(company);

      const reviews = await db('companies');

      expect(reviews).toHaveLength(1);
    });
  });
});