Skip to content
This repository has been archived by the owner on Apr 2, 2024. It is now read-only.

Commit

Permalink
fix(BUX-497): mockCapabilities
Browse files Browse the repository at this point in the history
  • Loading branch information
chris-4chain committed Jan 23, 2024
1 parent e432ef1 commit ac741b5
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions paymail_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ func TestPaymailClient(t *testing.T) {
require.NotNil(t, client)
}

func exampleGenericCapabilities(t *testing.T, p2pEnabled, beefEnabled bool) *paymail.CapabilitiesPayload {
func mockCapabilities(t *testing.T, p2pEnabled, beefEnabled bool) *paymail.CapabilitiesPayload {
options := []server.ConfigOps{
server.WithDomain("test.com"),
}
Expand All @@ -131,15 +131,15 @@ func Test_hasP2P(t *testing.T) {
t.Parallel()

t.Run("no p2p capabilities", func(t *testing.T) {
capabilities := exampleGenericCapabilities(t, false, false)
capabilities := mockCapabilities(t, false, false)
success, p2pDestinationURL, p2pSubmitTxURL, _ := hasP2P(capabilities)
assert.Equal(t, false, success)
assert.Equal(t, "", p2pDestinationURL)
assert.Equal(t, "", p2pSubmitTxURL)
})

t.Run("valid p2p capabilities", func(t *testing.T) {
capabilities := exampleGenericCapabilities(t, true, false)
capabilities := mockCapabilities(t, true, false)

success, p2pDestinationURL, p2pSubmitTxURL, _ := hasP2P(capabilities)
assert.Equal(t, true, success)
Expand All @@ -153,7 +153,7 @@ func Test_hasP2P_beefCapabilities(t *testing.T) {
t.Parallel()

t.Run("no beef capabilities", func(t *testing.T) {
capabilities := exampleGenericCapabilities(t, false, false)
capabilities := mockCapabilities(t, false, false)
success, p2pDestinationURL, p2pSubmitTxURL, format := hasP2P(capabilities)
assert.Equal(t, false, success)
assert.Equal(t, BasicPaymailPayloadFormat, format)
Expand All @@ -162,7 +162,7 @@ func Test_hasP2P_beefCapabilities(t *testing.T) {
})

t.Run("valid beef capabilities", func(t *testing.T) {
capabilities := exampleGenericCapabilities(t, true, true)
capabilities := mockCapabilities(t, true, true)
success, p2pDestinationURL, p2pSubmitTxURL, format := hasP2P(capabilities)
assert.Equal(t, true, success)
assert.Equal(t, BeefPaymailPayloadFormat, format)
Expand Down

0 comments on commit ac741b5

Please sign in to comment.