Skip to content

Commit 7e9eac1

Browse files
committed
test: added dummy test for get all networks
1 parent 532ca1c commit 7e9eac1

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
package dataaccess
2+
3+
import (
4+
"testing"
5+
6+
"github.com/gobitfly/beaconchain/pkg/api/types"
7+
"github.com/stretchr/testify/assert"
8+
)
9+
10+
func TestGetAllNetworks(t *testing.T) {
11+
d := &DataAccessService{}
12+
t.Run("GetAllNetworks", func(t *testing.T) {
13+
networks, err := d.GetAllNetworks()
14+
assert.Nil(t, err)
15+
assert.Contains(t, networks, types.NetworkInfo{
16+
ChainId: 1,
17+
Name: "ethereum",
18+
NotificationsName: "mainnet",
19+
})
20+
assert.Contains(t, networks, types.NetworkInfo{
21+
ChainId: 100,
22+
Name: "gnosis",
23+
NotificationsName: "gnosis",
24+
})
25+
assert.Contains(t, networks, types.NetworkInfo{
26+
ChainId: 17000,
27+
Name: "holesky",
28+
NotificationsName: "holesky",
29+
})
30+
assert.Contains(t, networks, types.NetworkInfo{
31+
ChainId: 11155111,
32+
Name: "sepolia",
33+
NotificationsName: "sepolia",
34+
})
35+
})
36+
}

0 commit comments

Comments
 (0)