huridocs/uwazi

View on GitHub
app/api/i18n.v2/model/specs/Translation.spec.ts

Summary

Maintainability
A
0 mins
Test Coverage
import { Translation } from '../Translation';

describe('Translation', () => {
  it('should throw an error if context.id is not a string', async () => {
    expect(
      () =>
        new Translation('key', 'value', 'es', {
          // @ts-ignore
          id: { value: 'invalid_id' },
          type: 'Entity',
          label: 'Entity',
        })
    ).toThrowError(new Error('context.id is of type "object", should be a string'));
  });
});