Skip to content

Commit

Permalink
Merge branch 'BB-768' of github.com:Tarunmeena0901/bookbrainz-site in…
Browse files Browse the repository at this point in the history
…to pr/1051
  • Loading branch information
MonkeyDo committed Jun 4, 2024
2 parents 0bfbe8f + 21dd8cf commit ac5d9b7
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions test/test-helpers/create-entities.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import {isNil} from 'lodash';
import orm from '../bookbrainz-data';


const {internet, random, string} = faker;
const {internet, string} = faker;

const {
bookshelf, util, Editor, EditorType, Revision, Relationship, RelationshipAttribute,
Expand Down Expand Up @@ -150,12 +150,12 @@ export function createEditor(editorId, privs = 1) {
const gender = await new Gender({name: 'test'})
.save(null, {method: 'insert', transacting});

editorAttribs.id = editorId || random.numeric(5);
editorAttribs.id = editorId || string.numeric(5);
editorAttribs.genderId = gender.id;
editorAttribs.typeId = editorType.id;
editorAttribs.name = internet.userName();
editorAttribs.privs = privs;
editorAttribs.metabrainzUserId = random.numeric(5);
editorAttribs.metabrainzUserId = string.numeric(5);
editorAttribs.cachedMetabrainzName = editorAttribs.name;

const editor = await new Editor(editorAttribs)
Expand Down Expand Up @@ -335,7 +335,7 @@ export async function createWork(optionalBBID, optionalWorkAttribs = {}) {

if (!workType) {
workType = await new WorkType({description: 'A work type',
label: `Work Type ${optionalWorkAttribs.typeId || random.numeric(5)}`,
label: `Work Type ${optionalWorkAttribs.typeId || string.numeric(5)}`,
...optionalWorkTypeAttribs})
.save(null, {method: 'insert'});
}
Expand All @@ -361,7 +361,7 @@ export async function createEditionGroup(optionalBBID, optionalEditionGroupAttri
optionalEditionGroupTypeAttrib.id = optionalEditionGroupAttrib.typeId;
}
const editionGroupType = await new EditionGroupType(
{label: `Edition Group Type ${optionalEditionGroupAttrib.typeId || random.numeric(5)}`, ...optionalEditionGroupTypeAttrib}
{label: `Edition Group Type ${optionalEditionGroupAttrib.typeId || string.numeric(5)}`, ...optionalEditionGroupTypeAttrib}
)
.save(null, {method: 'insert'});

Expand Down Expand Up @@ -474,7 +474,7 @@ export async function createPublisher(optionalBBID, optionalPublisherAttribs = {
.fetch({require: false});
}
if (!area) {
area = await new Area({gid: string.uuid(), name: `Area ${optionalPublisherAttribs.areaId || random.numeric(5)}`, ...optionalAreaAttribs})
area = await new Area({gid: string.uuid(), name: `Area ${optionalPublisherAttribs.areaId || string.numeric(5)}`, ...optionalAreaAttribs})
.save(null, {method: 'insert'});
}

Expand Down

0 comments on commit ac5d9b7

Please sign in to comment.