2021-12-02 04:00:33 +00:00
|
|
|
package ficsit
|
|
|
|
|
|
|
|
import (
|
|
|
|
"context"
|
|
|
|
"testing"
|
|
|
|
|
|
|
|
"github.com/Khan/genqlient/graphql"
|
|
|
|
"github.com/MarvinJWendt/testza"
|
2022-10-14 16:11:16 +00:00
|
|
|
|
2021-12-02 04:00:33 +00:00
|
|
|
"github.com/satisfactorymodding/ficsit-cli/cfg"
|
|
|
|
)
|
|
|
|
|
|
|
|
var client graphql.Client
|
|
|
|
|
|
|
|
func init() {
|
|
|
|
cfg.SetDefaults()
|
|
|
|
client = InitAPI()
|
|
|
|
}
|
|
|
|
|
|
|
|
func TestModVersions(t *testing.T) {
|
|
|
|
response, err := ModVersions(context.Background(), client, "SmartFoundations", VersionFilter{})
|
|
|
|
testza.AssertNoError(t, err)
|
|
|
|
testza.AssertNotNil(t, response)
|
2022-04-14 01:27:39 +00:00
|
|
|
testza.AssertNotNil(t, response.Mod)
|
|
|
|
testza.AssertNotNil(t, response.Mod.Versions)
|
|
|
|
testza.AssertNotZero(t, len(response.Mod.Versions))
|
2021-12-02 04:00:33 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func TestMods(t *testing.T) {
|
|
|
|
response, err := Mods(context.Background(), client, ModFilter{})
|
|
|
|
testza.AssertNoError(t, err)
|
|
|
|
testza.AssertNotNil(t, response)
|
2022-06-06 23:55:26 +00:00
|
|
|
testza.AssertNotNil(t, response.Mods)
|
|
|
|
testza.AssertNotNil(t, response.Mods.Mods)
|
|
|
|
testza.AssertNotZero(t, response.Mods.Count)
|
|
|
|
testza.AssertNotZero(t, len(response.Mods.Mods))
|
2021-12-02 04:00:33 +00:00
|
|
|
}
|