Skip to content

Commit

Permalink
fix: uses lo.ToPtr in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
AntiTyping committed May 14, 2024
1 parent e0bf776 commit 80496db
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions internal/fullnode/commands/addrbook_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package commands
import (
"testing"

"github.com/samber/lo"
cosmosv1 "github.com/strangelove-ventures/cosmos-operator/api/v1"
"github.com/stretchr/testify/require"
)
Expand Down Expand Up @@ -32,9 +33,8 @@ func TestDownloadAddrbookCommand(t *testing.T) {
})

t.Run("download", func(t *testing.T) {
addressBookUrl := "https://example.com/addrbook.json"
cfg := cosmosv1.ChainSpec{
AddrbookURL: &addressBookUrl,
AddrbookURL: lo.ToPtr("https://example.com/addrbook.json"),
}
cmd, args := DownloadAddrbookCommand(cfg)
require.Equal(t, "sh", cmd)
Expand All @@ -52,12 +52,10 @@ func TestDownloadAddrbookCommand(t *testing.T) {
})

t.Run("custom", func(t *testing.T) {
addressBookUrl := "https://example.com/addrbook.json"
addressBookScript := "echo hi"
cfg := cosmosv1.ChainSpec{
// Keeping this to assert that custom script takes precedence.
AddrbookURL: &addressBookUrl,
AddrbookScript: &addressBookScript,
AddrbookURL: lo.ToPtr("https://example.com/addrbook.json"),
AddrbookScript: lo.ToPtr("echo hi"),
}
cmd, args := DownloadAddrbookCommand(cfg)
require.Equal(t, "sh", cmd)
Expand Down

0 comments on commit 80496db

Please sign in to comment.