Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
 
Reduce test data amount until UI supports pagination (#378)
  • Loading branch information
KCarretto authored Nov 16, 2023
1 parent 0ae5eb5 commit 089f4f5
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions tavern/test_data.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import (

"github.com/kcarretto/realm/tavern/internal/ent"
"github.com/kcarretto/realm/tavern/internal/ent/tag"
"github.com/kcarretto/realm/tavern/internal/namegen"
)

// createTestData populates the DB with some test data :)
Expand Down Expand Up @@ -183,7 +184,7 @@ func createTestData(ctx context.Context, client *ent.Client) {
SetQuest(printQuest).
SaveX(ctx)

for i := 0; i < 50; i++ {
for i := 0; i < 5; i++ {
createQuest(ctx, client, testBeacons...)
}
}
Expand Down Expand Up @@ -347,14 +348,14 @@ None
func createQuest(ctx context.Context, client *ent.Client, beacons ...*ent.Beacon) {
// Mid-Execution
testTome := client.Tome.Create().
SetName(newRandomIdentifier()).
SetName(namegen.GetRandomName()).
SetDescription("Print a message for fun!").
SetEldritch(`print(input_params['msg'])`).
SetParamDefs(`[{"name":"msg","label":"Message","type":"string","placeholder":"something to print"}]`).
SaveX(ctx)

q := client.Quest.Create().
SetName(newRandomIdentifier()).
SetName(namegen.GetRandomName()).
SetParameters(`{"msg":"Hello World!"}`).
SetTome(testTome).
SaveX(ctx)
Expand Down

0 comments on commit 089f4f5

Please sign in to comment.