mirror of
https://github.com/discourse/discourse.git
synced 2025-05-31 03:38:05 +08:00
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:
@ -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();
|
||||
|
||||
|
Reference in New Issue
Block a user