package client

import (
	"context"
	"testing"

	"git.sr.ht/~ashkeel/strimertul/twitch"

	"git.sr.ht/~ashkeel/strimertul/database"
	"git.sr.ht/~ashkeel/strimertul/webserver"
)

func TestNewClient(t *testing.T) {
	client, _ := database.CreateInMemoryLocalClient(t)
	defer database.CleanupLocalClient(client)

	server, err := webserver.NewServer(context.Background(), client, webserver.DefaultServerFactory)
	if err != nil {
		t.Fatal(err)
	}

	config := twitch.Config{}
	_, err = newClient(context.Background(), config, client, server)
	if err != nil {
		t.Fatal(err)
	}
}
