UNPKG

@dossierhq/integration-test

Version:

Integration test to ensure that different Dossier database adapters work as expected.

250 lines 9.62 kB
/// <reference types="./SchemaTypes.d.ts" /> export function isChangeValidations(entity) { return entity.info.type === 'ChangeValidations'; } export function assertIsChangeValidations(entity) { if (entity.info.type !== 'ChangeValidations') { throw new Error('Expected info.type = ChangeValidations (but was ' + entity.info.type + ')'); } } export function isComponents(entity) { return entity.info.type === 'Components'; } export function assertIsComponents(entity) { if (entity.info.type !== 'Components') { throw new Error('Expected info.type = Components (but was ' + entity.info.type + ')'); } } export function isLocations(entity) { return entity.info.type === 'Locations'; } export function assertIsLocations(entity) { if (entity.info.type !== 'Locations') { throw new Error('Expected info.type = Locations (but was ' + entity.info.type + ')'); } } export function isMigrationEntity(entity) { return entity.info.type === 'MigrationEntity'; } export function assertIsMigrationEntity(entity) { if (entity.info.type !== 'MigrationEntity') { throw new Error('Expected info.type = MigrationEntity (but was ' + entity.info.type + ')'); } } export function isReadOnly(entity) { return entity.info.type === 'ReadOnly'; } export function assertIsReadOnly(entity) { if (entity.info.type !== 'ReadOnly') { throw new Error('Expected info.type = ReadOnly (but was ' + entity.info.type + ')'); } } export function isReferences(entity) { return entity.info.type === 'References'; } export function assertIsReferences(entity) { if (entity.info.type !== 'References') { throw new Error('Expected info.type = References (but was ' + entity.info.type + ')'); } } export function isRichTexts(entity) { return entity.info.type === 'RichTexts'; } export function assertIsRichTexts(entity) { if (entity.info.type !== 'RichTexts') { throw new Error('Expected info.type = RichTexts (but was ' + entity.info.type + ')'); } } export function isStrings(entity) { return entity.info.type === 'Strings'; } export function assertIsStrings(entity) { if (entity.info.type !== 'Strings') { throw new Error('Expected info.type = Strings (but was ' + entity.info.type + ')'); } } export function isSubjectOnly(entity) { return entity.info.type === 'SubjectOnly'; } export function assertIsSubjectOnly(entity) { if (entity.info.type !== 'SubjectOnly') { throw new Error('Expected info.type = SubjectOnly (but was ' + entity.info.type + ')'); } } export function isSubjectOrDefaultAuthKey(entity) { return entity.info.type === 'SubjectOrDefaultAuthKey'; } export function assertIsSubjectOrDefaultAuthKey(entity) { if (entity.info.type !== 'SubjectOrDefaultAuthKey') { throw new Error('Expected info.type = SubjectOrDefaultAuthKey (but was ' + entity.info.type + ')'); } } export function isTitleOnly(entity) { return entity.info.type === 'TitleOnly'; } export function assertIsTitleOnly(entity) { if (entity.info.type !== 'TitleOnly') { throw new Error('Expected info.type = TitleOnly (but was ' + entity.info.type + ')'); } } export function isAdminOnlyComponent(component) { return component.type === 'AdminOnlyComponent'; } export function assertIsAdminOnlyComponent(component) { if (component.type !== 'AdminOnlyComponent') { throw new Error('Expected type = AdminOnlyComponent (but was ' + component.type + ')'); } } export function isChangeValidationsComponent(component) { return component.type === 'ChangeValidationsComponent'; } export function assertIsChangeValidationsComponent(component) { if (component.type !== 'ChangeValidationsComponent') { throw new Error('Expected type = ChangeValidationsComponent (but was ' + component.type + ')'); } } export function isLocationsComponent(component) { return component.type === 'LocationsComponent'; } export function assertIsLocationsComponent(component) { if (component.type !== 'LocationsComponent') { throw new Error('Expected type = LocationsComponent (but was ' + component.type + ')'); } } export function isMigrationComponent(component) { return component.type === 'MigrationComponent'; } export function assertIsMigrationComponent(component) { if (component.type !== 'MigrationComponent') { throw new Error('Expected type = MigrationComponent (but was ' + component.type + ')'); } } export function isReferencesComponent(component) { return component.type === 'ReferencesComponent'; } export function assertIsReferencesComponent(component) { if (component.type !== 'ReferencesComponent') { throw new Error('Expected type = ReferencesComponent (but was ' + component.type + ')'); } } export function isPublishedChangeValidations(entity) { return entity.info.type === 'ChangeValidations'; } export function assertIsPublishedChangeValidations(entity) { if (entity.info.type !== 'ChangeValidations') { throw new Error('Expected info.type = ChangeValidations (but was ' + entity.info.type + ')'); } } export function isPublishedComponents(entity) { return entity.info.type === 'Components'; } export function assertIsPublishedComponents(entity) { if (entity.info.type !== 'Components') { throw new Error('Expected info.type = Components (but was ' + entity.info.type + ')'); } } export function isPublishedLocations(entity) { return entity.info.type === 'Locations'; } export function assertIsPublishedLocations(entity) { if (entity.info.type !== 'Locations') { throw new Error('Expected info.type = Locations (but was ' + entity.info.type + ')'); } } export function isPublishedMigrationEntity(entity) { return entity.info.type === 'MigrationEntity'; } export function assertIsPublishedMigrationEntity(entity) { if (entity.info.type !== 'MigrationEntity') { throw new Error('Expected info.type = MigrationEntity (but was ' + entity.info.type + ')'); } } export function isPublishedReadOnly(entity) { return entity.info.type === 'ReadOnly'; } export function assertIsPublishedReadOnly(entity) { if (entity.info.type !== 'ReadOnly') { throw new Error('Expected info.type = ReadOnly (but was ' + entity.info.type + ')'); } } export function isPublishedReferences(entity) { return entity.info.type === 'References'; } export function assertIsPublishedReferences(entity) { if (entity.info.type !== 'References') { throw new Error('Expected info.type = References (but was ' + entity.info.type + ')'); } } export function isPublishedRichTexts(entity) { return entity.info.type === 'RichTexts'; } export function assertIsPublishedRichTexts(entity) { if (entity.info.type !== 'RichTexts') { throw new Error('Expected info.type = RichTexts (but was ' + entity.info.type + ')'); } } export function isPublishedStrings(entity) { return entity.info.type === 'Strings'; } export function assertIsPublishedStrings(entity) { if (entity.info.type !== 'Strings') { throw new Error('Expected info.type = Strings (but was ' + entity.info.type + ')'); } } export function isPublishedSubjectOnly(entity) { return entity.info.type === 'SubjectOnly'; } export function assertIsPublishedSubjectOnly(entity) { if (entity.info.type !== 'SubjectOnly') { throw new Error('Expected info.type = SubjectOnly (but was ' + entity.info.type + ')'); } } export function isPublishedSubjectOrDefaultAuthKey(entity) { return entity.info.type === 'SubjectOrDefaultAuthKey'; } export function assertIsPublishedSubjectOrDefaultAuthKey(entity) { if (entity.info.type !== 'SubjectOrDefaultAuthKey') { throw new Error('Expected info.type = SubjectOrDefaultAuthKey (but was ' + entity.info.type + ')'); } } export function isPublishedTitleOnly(entity) { return entity.info.type === 'TitleOnly'; } export function assertIsPublishedTitleOnly(entity) { if (entity.info.type !== 'TitleOnly') { throw new Error('Expected info.type = TitleOnly (but was ' + entity.info.type + ')'); } } export function isPublishedChangeValidationsComponent(component) { return component.type === 'ChangeValidationsComponent'; } export function assertIsPublishedChangeValidationsComponent(component) { if (component.type !== 'ChangeValidationsComponent') { throw new Error('Expected type = ChangeValidationsComponent (but was ' + component.type + ')'); } } export function isPublishedLocationsComponent(component) { return component.type === 'LocationsComponent'; } export function assertIsPublishedLocationsComponent(component) { if (component.type !== 'LocationsComponent') { throw new Error('Expected type = LocationsComponent (but was ' + component.type + ')'); } } export function isPublishedMigrationComponent(component) { return component.type === 'MigrationComponent'; } export function assertIsPublishedMigrationComponent(component) { if (component.type !== 'MigrationComponent') { throw new Error('Expected type = MigrationComponent (but was ' + component.type + ')'); } } export function isPublishedReferencesComponent(component) { return component.type === 'ReferencesComponent'; } export function assertIsPublishedReferencesComponent(component) { if (component.type !== 'ReferencesComponent') { throw new Error('Expected type = ReferencesComponent (but was ' + component.type + ')'); } } //# sourceMappingURL=SchemaTypes.js.map