DEV: minimum fabricators for post/topic (#26671)

I will add new default properties as needed in the future, but for now this is enough to have an entry point.
This commit is contained in:
Joffrey JAFFEUX
2024-04-18 09:54:23 +02:00
committed by GitHub
parent 99d22c85ae
commit 09311c7dab

View File

@ -29,6 +29,20 @@ export default class CoreFabricators {
setOwner(this, owner);
}
post(args = {}) {
return this.store.createRecord("post", {
id: args.id || incrementSequence(),
topic: args.topic || this.topic(),
});
}
topic(args = {}) {
return this.store.createRecord("topic", {
id: args.id || incrementSequence(),
title: args.title || getLoadedFaker().faker.commerce.productName(),
});
}
category(args = {}) {
const name = args.name || getLoadedFaker().faker.commerce.product();