Skip to content

Merge pull request #309 from kellnerd/ts-migration #85

Merge pull request #309 from kellnerd/ts-migration

Merge pull request #309 from kellnerd/ts-migration #85

GitHub Actions / Mocha test results succeeded Oct 18, 2023 in 0s

Mocha test results ✅

Tests passed successfully

✅ test-results.json

160 tests were completed in 32s with 160 passed, 0 failed and 0 skipped.

Test suite Passed Failed Skipped Time
test/func/alias.js 8✅ 205ms
test/func/area.js 3✅ 5ms
test/func/author-credit.js 4✅ 78ms
test/func/entity.js 5✅ 41ms
test/func/externalServiceOauth.js 4✅ 8ms
test/func/identifier.js 4✅ 60ms
test/func/language.js 3✅ 38ms
test/func/relationship.js 4✅ 187ms
test/func/relationshipAttributes.js 4✅ 65ms
test/func/set.js 16✅ 51ms
test/func/work.js 2✅ 4ms
test/testAchievementType.js 1✅ 5ms
test/testAchievementUnlock.js 1✅ 4ms
test/testAlias.js 1✅ 3ms
test/testAliasSet.js 4✅ 37ms
test/testAnnotation.js 1✅ 7ms
test/testArea.js 3✅ 20ms
test/testAuthor.js 7✅ 124ms
test/testAuthorRevision.js 1✅ 7ms
test/testDisambiguation.js 1✅ 4ms
test/testEdition.js 7✅ 175ms
test/testEditionGroup.js 4✅ 62ms
test/testEditionGroupRevision.js 1✅ 7ms
test/testEditionRevision.js 1✅ 5ms
test/testEditor.js 1✅ 10ms
test/testEditorEntityVisits.js 1✅ 7ms
test/testEditorType.js 1✅ 4ms
test/testEntity.js 1✅ 4ms
test/testExternalServiceOauth.js 1✅ 5ms
test/testGender.js 1✅ 8ms
test/testIdentifier.js 1✅ 7ms
test/testIdentifierSet.js 4✅ 29ms
test/testIdentifierType.js 1✅ 4ms
test/testLanguage.js 1✅ 3ms
test/testLanguageSet.js 4✅ 30ms
test/testModule.js 3✅ 6ms
test/testPublisher.js 4✅ 62ms
test/testPublisherRevision.js 1✅ 6ms
test/testRelationship.js 2✅ 37ms
test/testRelationshipAttributes.js 1✅ 5ms
test/testRelationshipAttributeSet.js 4✅ 33ms
test/testRelationshipAttributeType.js 1✅ 3ms
test/testRelationshipSet.js 4✅ 33ms
test/testRelationshipType.js 2✅ 13ms
test/testRevision.js 1✅ 11ms
test/testSeries.js 5✅ 73ms
test/testSeriesOrderingType.js 1✅ 3ms
test/testSeriesRevision.js 1✅ 7ms
test/testTitleType.js 1✅ 3ms
test/testTitleUnlock.js 1✅ 3ms
test/testUserCollection.js 2✅ 19ms
test/testWork.js 4✅ 56ms
test/testWorkRevision.js 1✅ 6ms
test/util.js 14✅ 2ms

✅ test/func/alias.js

updateAliasSet
  ✅ should allow only one primary alias per language
  ✅ should allow only the default alias to be primary for that language
  ✅ should error if a set of aliases is passed with no default
  ✅ should return a new set if changes are made to the aliases in the set
  ✅ should return a new set if the default alias is changed
  ✅ should return a set with one alias if one alias is added to an empty set
  ✅ should return null if all null/empty sets are passed
  ✅ should return the old set if no changes are made

✅ test/func/area.js

recursivelyGetAreaParentsWithNames
  ✅ should return all levels when checkAllLevels is true
  ✅ should return an array of areas with their names, sorted by type
  ✅ should work when calling parents() on an Area model

✅ test/func/author-credit.js

fetchOrCreateCredit
  ✅ should create a single author credit if called twice
updateCreateCredit
  ✅ should return a new credit if the credit is updated
  ✅ should return the original credit if changed, and then reverted
  ✅ should return the original credit if the credit is unchanged

✅ test/func/entity.js

getEntity
  ✅ should return an entity
  ✅ should return an entity with extra relations
  ✅ should return the target entity for a redirected bbid
recursivelyGetRedirectBBID
  ✅ should return a multiple-step redirected bbid
  ✅ should return a single-step redirected bbid

✅ test/func/externalServiceOauth.js

deleteOauthToken
  ✅ should delete oauth token
getOauthToken
  ✅ should return oauth token
saveOauthToken
  ✅ should save oauth token and return the saved token
updateOauthToken
  ✅ should update oauth token

✅ test/func/identifier.js

updateIdentifierSet
  ✅ should return a new set if changes are made to the identifiers in the set
  ✅ should return a set with one identifier if one identifier is added to an empty set
  ✅ should return null if all null/empty sets are passed
  ✅ should return the old set if no changes are made

✅ test/func/language.js

updateLanguageSet
  ✅ should return a set with one language if one language is added to an empty set
  ✅ should return null if all null/empty sets are passed
  ✅ should return the old set if no changes are made

✅ test/func/relationship.js

updateRelationshipSet
  ✅ should return a new set if changes are made to the relationships in the set
  ✅ should return an empty object if all null/empty sets are passed
  ✅ should return an object with two entries if one relationship is added to an empty set
  ✅ should return the old set if no changes are made

✅ test/func/relationshipAttributes.js

updateRelationshipAttributeSet
  ✅ should return a new set if changes are made to the attributes in the set
  ✅ should return a set with one attribute if one attribute is added to an empty set
  ✅ should return null if all null/empty sets are passed
  ✅ should return the old set if no changes are made

✅ test/func/set.js

createNewSetWithItems
  ✅ should error out if non-existent unchanged items are provided
  ✅ should return a new set with one item if an item is added
  ✅ should return a new set with two items if an item is added to an existing unchanged item
  ✅ should return null if no items are provided
getAddedItems
  ✅ should return a single element when one element is different
  ✅ should return a single element when one element is different and duplicated
  ✅ should return an empty list for two arrays of identical objects
getRemovedItems
  ✅ should return a single element when one element is different
  ✅ should return a single element when one element is different and duplicated
  ✅ should return an empty list for two arrays of identical objects
getUnchangedItems
  ✅ should return a single element when one duplicated element is the same
  ✅ should return a single element when one element is different
  ✅ should return all objects for two arrays of identical objects
removeItemsFromSet
  ✅ should return a single element when one element is different
  ✅ should return a single element when one element is different and duplicated
  ✅ should return an empty list for two arrays of identical objects

✅ test/func/work.js

loadAuthorNames
  ✅ should return an array of objects with appropriate keys when the list of workBBIDs is not empty
  ✅ should return an empty array if the list of workBBIDs is empty

✅ test/testAchievementType.js

AchievementType model
  ✅ should return a JSON object with correct keys when saved

✅ test/testAchievementUnlock.js

AchievementUnlock model
  ✅ should return a JSON object with correct keys when saved

✅ test/testAlias.js

Alias model
  ✅ should return a JSON object with correct keys when saved

✅ test/testAliasSet.js

AliasSet model
  ✅ should have an empty list of aliases when none are attached
  ✅ should have have an alias when one is set
  ✅ should have have two aliases when two are set
  ✅ should return a JSON object with correct keys when saved

✅ test/testAnnotation.js

Annotation model
  ✅ should return a JSON object with correct keys when saved

✅ test/testArea.js

Area model
  ✅ should return a JSON object with correct keys when saved
AreaType model
  ✅ should be fetched as relationship when fetching Area
  ✅ should return a JSON object with correct keys when saved

✅ test/testAuthor.js

Author model
  ✅ should return a JSON object with correct keys when saved
  ✅ should return a JSON object with empty collections array
  ✅ should return a JSON object with related collections if there exist any
  ✅ should return the master revision when multiple revisions exist
Author model with Author Credits
  ✅ should return the associated Author Credits for an Author
  ✅ should return the associated Edition Groups using creditedEditionGroups method
  ✅ should return the associated Editions using creditedEditions method

✅ test/testAuthorRevision.js

AuthorRevision model
  ✅ should return a JSON object with correct keys when saved

✅ test/testDisambiguation.js

Disambiguation model
  ✅ should return a JSON object with correct keys when saved

✅ test/testEdition.js

Edition model
  ✅ should automatically create an Edition Group editionGroupBbid has been unset in existing Edition
  ✅ should automatically create an Edition Group if none has been passed
  ✅ should return a JSON object with correct keys when saved
  ✅ should return a JSON object with empty collections array
  ✅ should return a JSON object with related collections if there exist any
  ✅ should return the master revision when multiple revisions exist
  ✅ should set the same Author Credit on auto-created Edition Group

✅ test/testEditionGroup.js

EditionGroup model
  ✅ should return a JSON object with correct keys when saved
  ✅ should return a JSON object with empty collections array
  ✅ should return a JSON object with related collections if there exist any
  ✅ should return the master revision when multiple revisions exist

✅ test/testEditionGroupRevision.js

EditionGroupRevision model
  ✅ should return a JSON object with correct keys when saved

✅ test/testEditionRevision.js

EditionRevision model
  ✅ should return a JSON object with correct keys when saved

✅ test/testEditor.js

Editor model
  ✅ should return a JSON object with correct keys when saved

✅ test/testEditorEntityVisits.js

EditorEntityVisits model
  ✅ should return a JSON object with correct keys when saved

✅ test/testEditorType.js

EditorType model
  ✅ should return a JSON object with correct keys when saved

✅ test/testEntity.js

Entity model
  ✅ should return a JSON object with correct keys when saved

✅ test/testExternalServiceOauth.js

ExternalServiceOauth model
  ✅ should return a JSON object with correct keys when saved

✅ test/testGender.js

Gender model
  ✅ should return a JSON object with correct keys when saved

✅ test/testIdentifier.js

Identifier model
  ✅ should return a JSON object with correct keys when saved

✅ test/testIdentifierSet.js

IdentifierSet model
  ✅ should have an empty list of identifiers when none are attached
  ✅ should have have an identifier when one is set
  ✅ should have have two identifiers when two are set
  ✅ should return a JSON object with correct keys when saved

✅ test/testIdentifierType.js

IdentifierType model
  ✅ should return a JSON object with correct keys when saved

✅ test/testLanguage.js

Language model
  ✅ should return a JSON object with correct keys when saved

✅ test/testLanguageSet.js

LanguageSet model
  ✅ should have an empty list of languages when none are attached
  ✅ should have have a language when one is set
  ✅ should have have two languages when two are set
  ✅ should return a JSON object with correct keys when saved

✅ test/testModule.js

Module
  ✅ should have a bookshelf property with a knex property
  ✅ should have bookshelf and utils properties
  ✅ should return one model for each file in the models directory

✅ test/testPublisher.js

Publisher model
  ✅ should return a JSON object with correct keys when saved
  ✅ should return a JSON object with empty collections array
  ✅ should return a JSON object with related collections if there exist any
  ✅ should return the master revision when multiple revisions exist

✅ test/testPublisherRevision.js

PublisherRevision model
  ✅ should return a JSON object with correct keys when saved

✅ test/testRelationship.js

Relationship model
  ✅ should return a JSON object with correct keys when saved
  ✅ should return a relationship with it's attributes when one is set

✅ test/testRelationshipAttributes.js

Relationship Attribute model
  ✅ should return a JSON object with correct keys when saved

✅ test/testRelationshipAttributeSet.js

RelationshipAttributeSet model
  ✅ should have an empty list of attributes when none are attached
  ✅ should have have a relationship attribute when one is set
  ✅ should have have two relationship attributes when two are set
  ✅ should return a JSON object with correct keys when saved

✅ test/testRelationshipAttributeType.js

RelationshipAttributeType model
  ✅ should return a JSON object with correct keys when saved

✅ test/testRelationshipSet.js

RelationshipSet model
  ✅ should have an empty list of relationships when none are attached
  ✅ should have have a relationship when one is set
  ✅ should have have two relationships when two are set
  ✅ should return a JSON object with correct keys when saved

✅ test/testRelationshipType.js

RelationshipType model
  ✅ should return a JSON object with correct keys when saved
  ✅ should return attribute type associated with the relationship type

✅ test/testRevision.js

Revision model
  ✅ should return a JSON object with correct keys when saved

✅ test/testSeries.js

Series model
  ✅ should allow to update the series ordering type
  ✅ should return a JSON object with correct keys when saved
  ✅ should return a JSON object with empty collections array
  ✅ should return a JSON object with related collections
  ✅ should return the master revision when multiple revisions exist

✅ test/testSeriesOrderingType.js

SeriesOrderingType model
  ✅ should return a JSON object with correct keys when saved

✅ test/testSeriesRevision.js

SeriesRevision model
  ✅ should return a JSON object with correct keys when saved

✅ test/testTitleType.js

TitleType model
  ✅ should return a JSON object with correct keys when saved

✅ test/testTitleUnlock.js

TitleUnlock model
  ✅ should return a JSON object with correct keys when saved

✅ test/testUserCollection.js

UserCollection model
  ✅ should return a JSON object with itemCount when saved and fetched with withItemCount flag
  ✅ should return a JSON object without itemCount when saved and fetched without withItemCount flag

✅ test/testWork.js

Work model
  ✅ should return a JSON object with correct keys when saved
  ✅ should return a JSON object with empty collections array
  ✅ should return a JSON object with related collections
  ✅ should return the master revision when multiple revisions exist

✅ test/testWorkRevision.js

WorkRevision model
  ✅ should return a JSON object with correct keys when saved

✅ test/util.js

Utils formatDate
  ✅ should allow negative years for full date and with missing month and/or day
  ✅ should return null when passed an invalid date object
  ✅ should return the date as ISO 8601 for a date object with missing month
  ✅ should return the date as ISO 8601 for a date object with missing month and day
  ✅ should return the date as ISO 8601 for a date object with year equal to zero
  ✅ should return the date as ISO 8601 for a full date object
Utils parseDate
  ✅ should allow BCE dates as extended ISO 8601-2004 date string
  ✅ should allow partial BCE dates as extended ISO 8601-2004 with missing day
  ✅ should allow partial BCE dates as extended ISO 8601-2004 with missing day and month
  ✅ should allow partial dates with missing day
  ✅ should allow partial dates with missing day and month
  ✅ should return an array of 3 null values when passed an invalid string (other than ISO 8601)
  ✅ should return the date as an array of 3 values when passed a full ISO 8601 date string
  ✅ should return the date as an array of 3 values when passed an extended ISO 8601-2004 date string