mirror of
https://github.com/hanzo-fi/stack.git
synced 2026-10-30 20:34:43 +00:00
33 lines
1.0 KiB
Go
33 lines
1.0 KiB
Go
package suite
|
|
|
|
import (
|
|
"fmt"
|
|
"github.com/formancehq/formance-sdk-go/pkg/models/operations"
|
|
. "github.com/formancehq/stack/tests/integration/internal"
|
|
"github.com/formancehq/stack/tests/integration/internal/modules"
|
|
. "github.com/onsi/ginkgo/v2"
|
|
. "github.com/onsi/gomega"
|
|
"net/http"
|
|
)
|
|
|
|
var _ = WithModules([]*Module{modules.Ledger}, func() {
|
|
const count = 3
|
|
When(fmt.Sprintf("creating %d ledger", count), func() {
|
|
BeforeEach(func() {
|
|
for i := 0; i < count; i++ {
|
|
createLedgerResponse, err := Client().Ledger.V2CreateLedger(TestContext(), operations.V2CreateLedgerRequest{
|
|
Ledger: fmt.Sprintf("ledger%d", i),
|
|
})
|
|
Expect(err).To(BeNil())
|
|
Expect(createLedgerResponse.StatusCode).To(Equal(http.StatusNoContent))
|
|
}
|
|
})
|
|
It("should be listable on api", func() {
|
|
response, err := Client().Ledger.V2ListLedgers(TestContext(), operations.V2ListLedgersRequest{})
|
|
Expect(err).ToNot(HaveOccurred())
|
|
Expect(response.StatusCode).To(Equal(http.StatusOK))
|
|
Expect(response.V2LedgerListResponse.Cursor.Data).To(HaveLen(count))
|
|
})
|
|
})
|
|
})
|