@@ -18,8 +18,10 @@ describe('ConnectWallet component ', () => {
18
18
expect ( screen . getByText ( 'LN Message' ) ) . toBeInTheDocument ( ) ;
19
19
expect ( screen . getByTestId ( 'port' ) ) . toHaveValue ( '5001' ) ;
20
20
expect ( screen . getByTestId ( 'host' ) ) . toHaveValue ( 'user.local' ) ;
21
- expect ( screen . getByTestId ( 'macaroon' ) ) . toHaveValue ( 'mRXhnFyVWrRQChA9eJ01RQT9W502daqrP0JA4BiHHw89MCZGb3IgQXBwbGljYXRpb24j' ) ;
22
- expect ( screen . getByTestId ( 'connect-url' ) ) . toHaveValue ( 'ln-message://user.local:5001?rune=mRXhnFyVWrRQChA9eJ01RQT9W502daqrP0JA4BiHHw89MCZGb3IgQXBwbGljYXRpb24j' ) ;
21
+ expect ( screen . getByTestId ( 'rune' ) ) . toHaveValue ( 'mRXhnFyVWrRQChA9eJ01RQT9W502daqrP0JA4BiHHw89MCZGb3IgQXBwbGljYXRpb24j' ) ;
22
+ expect ( screen . getByTestId ( 'connect-url' ) ) . toHaveValue (
23
+ 'ln-message://user.local:5001?rune=mRXhnFyVWrRQChA9eJ01RQT9W502daqrP0JA4BiHHw89MCZGb3IgQXBwbGljYXRpb24j&invoiceRune=aHFhnFyVWrRQChA9eJ01RQT9W502daqrP0JA4BiHHw89MCZGb3IgQXBwbGljYXRpb2==' ,
24
+ ) ;
23
25
expect ( screen . getByTestId ( 'invoice-rune' ) ) . toHaveValue ( 'aHFhnFyVWrRQChA9eJ01RQT9W502daqrP0JA4BiHHw89MCZGb3IgQXBwbGljYXRpb2==' ) ;
24
26
expect ( screen . queryByTestId ( 'invoice-rune-spinner' ) ) . not . toBeInTheDocument ( ) ;
25
27
} ) ;
@@ -41,10 +43,12 @@ describe('ConnectWallet component ', () => {
41
43
42
44
expect ( screen . getByTestId ( 'port' ) ) . toHaveValue ( '5001' ) ;
43
45
expect ( screen . getByTestId ( 'host' ) ) . toHaveValue ( 'user.local' ) ;
44
- expect ( screen . getByTestId ( 'macaroon ' ) ) . toHaveValue ( 'mRXhnFyVWrRQChA9eJ01RQT9W502daqrP0JA4BiHHw89MCZGb3IgQXBwbGljYXRpb24j' ) ;
46
+ expect ( screen . getByTestId ( 'rune ' ) ) . toHaveValue ( 'mRXhnFyVWrRQChA9eJ01RQT9W502daqrP0JA4BiHHw89MCZGb3IgQXBwbGljYXRpb24j' ) ;
45
47
expect ( screen . queryByTestId ( 'client-cert' ) ) . not . toBeInTheDocument ( ) ;
46
48
expect ( screen . queryByTestId ( 'ca-cert' ) ) . not . toBeInTheDocument ( ) ;
47
- expect ( screen . getByTestId ( 'connect-url' ) ) . toHaveValue ( 'ln-message://user.local:5001?rune=mRXhnFyVWrRQChA9eJ01RQT9W502daqrP0JA4BiHHw89MCZGb3IgQXBwbGljYXRpb24j' ) ;
49
+ expect ( screen . getByTestId ( 'connect-url' ) ) . toHaveValue (
50
+ 'ln-message://user.local:5001?rune=mRXhnFyVWrRQChA9eJ01RQT9W502daqrP0JA4BiHHw89MCZGb3IgQXBwbGljYXRpb24j&invoiceRune=aHFhnFyVWrRQChA9eJ01RQT9W502daqrP0JA4BiHHw89MCZGb3IgQXBwbGljYXRpb2==' ,
51
+ ) ;
48
52
expect ( screen . getByTestId ( 'invoice-rune' ) ) . toHaveValue ( 'aHFhnFyVWrRQChA9eJ01RQT9W502daqrP0JA4BiHHw89MCZGb3IgQXBwbGljYXRpb2==' ) ;
49
53
} ) ;
50
54
@@ -57,11 +61,13 @@ describe('ConnectWallet component ', () => {
57
61
await act ( async ( ) => fireEvent . click ( restNetworkItem ) ) ;
58
62
59
63
expect ( screen . getByTestId ( 'port' ) ) . toHaveValue ( '5001' ) ;
60
- expect ( screen . getByTestId ( 'host' ) ) . toHaveValue ( 'oqaer4kd7ufryngx6dsztovs4pnlmaouwmtkofjsd2m7pkq8wd.onion' ) ;
61
- expect ( screen . getByTestId ( 'macaroon ' ) ) . toHaveValue ( 'mRXhnFyVWrRQChA9eJ01RQT9W502daqrP0JA4BiHHw89MCZGb3IgQXBwbGljYXRpb24j' ) ;
64
+ expect ( screen . getByTestId ( 'host' ) ) . toHaveValue ( 'http:// oqaer4kd7ufryngx6dsztovs4pnlmaouwmtkofjsd2m7pkq8wd.onion' ) ;
65
+ expect ( screen . getByTestId ( 'rune ' ) ) . toHaveValue ( 'mRXhnFyVWrRQChA9eJ01RQT9W502daqrP0JA4BiHHw89MCZGb3IgQXBwbGljYXRpb24j' ) ;
62
66
expect ( screen . queryByTestId ( 'client-cert' ) ) . not . toBeInTheDocument ( ) ;
63
67
expect ( screen . queryByTestId ( 'ca-cert' ) ) . not . toBeInTheDocument ( ) ;
64
- expect ( screen . getByTestId ( 'connect-url' ) ) . toHaveValue ( 'ln-message://oqaer4kd7ufryngx6dsztovs4pnlmaouwmtkofjsd2m7pkq8wd.onion:5001?rune=mRXhnFyVWrRQChA9eJ01RQT9W502daqrP0JA4BiHHw89MCZGb3IgQXBwbGljYXRpb24j' ) ;
68
+ expect ( screen . getByTestId ( 'connect-url' ) ) . toHaveValue (
69
+ 'ln-message://http://oqaer4kd7ufryngx6dsztovs4pnlmaouwmtkofjsd2m7pkq8wd.onion:5001?rune=mRXhnFyVWrRQChA9eJ01RQT9W502daqrP0JA4BiHHw89MCZGb3IgQXBwbGljYXRpb24j&invoiceRune=aHFhnFyVWrRQChA9eJ01RQT9W502daqrP0JA4BiHHw89MCZGb3IgQXBwbGljYXRpb2==' ,
70
+ ) ;
65
71
expect ( screen . getByTestId ( 'invoice-rune' ) ) . toHaveValue ( 'aHFhnFyVWrRQChA9eJ01RQT9W502daqrP0JA4BiHHw89MCZGb3IgQXBwbGljYXRpb2==' ) ;
66
72
} ) ;
67
73
@@ -73,13 +79,14 @@ describe('ConnectWallet component ', () => {
73
79
const restNetworkItem = screen . getAllByTestId ( 'network-item' ) [ 2 ] ;
74
80
await act ( async ( ) => fireEvent . click ( restNetworkItem ) ) ;
75
81
76
- expect ( screen . getByTestId ( 'port' ) ) . toHaveValue ( '3001' ) ;
77
- expect ( screen . getByTestId ( 'host' ) ) . toHaveValue ( 'http://user.local' ) ;
78
- expect ( screen . getByTestId ( 'macaroon' ) ) . toHaveValue ( '0201036c6e6402e501030a1042beb666ba043f72cb147adf3eaafc9e1201301a160a076164647265737312047265616' ) ;
79
- expect ( screen . queryByTestId ( 'client-cert' ) ) . not . toBeInTheDocument ( ) ;
80
- expect ( screen . queryByTestId ( 'ca-cert' ) ) . not . toBeInTheDocument ( ) ;
81
- expect ( screen . getByTestId ( 'connect-url' ) ) . toHaveValue ( 'c-lightning-rest://http://user.local:3001?macaroon=0201036c6e6402e501030a1042beb666ba043f72cb147adf3eaafc9e1201301a160a076164647265737312047265616&protocol=http' ) ;
82
- expect ( screen . queryByTestId ( 'invoice-rune' ) ) . not . toBeInTheDocument ( ) ;
82
+ expect ( screen . getAllByTestId ( 'port' ) [ 1 ] ) . toHaveValue ( '3001' ) ;
83
+ expect ( screen . getByTestId ( 'host' ) ) . toHaveValue ( 'user.local' ) ;
84
+ expect ( screen . queryByTestId ( 'client-key' ) ) . toBeInTheDocument ( ) ;
85
+ expect ( screen . queryByTestId ( 'client-cert' ) ) . toBeInTheDocument ( ) ;
86
+ expect ( screen . queryByTestId ( 'ca-cert' ) ) . toBeInTheDocument ( ) ;
87
+ expect ( screen . getByTestId ( 'connect-url' ) ) . toHaveValue (
88
+ 'clnrest://https://user.local:3001?clientKey=ClientKey&clientCert=ClientCert&caCert=CACert' ,
89
+ ) ;
83
90
} ) ;
84
91
85
92
it ( 'updates selected network and input fields on network change to REST (Tor)' , async ( ) => {
@@ -90,13 +97,13 @@ describe('ConnectWallet component ', () => {
90
97
const restNetworkItem = screen . getAllByTestId ( 'network-item' ) [ 3 ] ;
91
98
await act ( async ( ) => fireEvent . click ( restNetworkItem ) ) ;
92
99
93
- expect ( screen . getByTestId ( 'port' ) ) . toHaveValue ( '3001' ) ;
100
+ expect ( screen . getAllByTestId ( 'port' ) [ 1 ] ) . toHaveValue ( '3001' ) ;
94
101
expect ( screen . getByTestId ( 'host' ) ) . toHaveValue ( 'http://oqaer4kd7ufryngx6dsztovs4pnlmaouwmtkofjsd2m7pkq8wd.onion' ) ;
95
- expect ( screen . getByTestId ( 'macaroon ') ) . toHaveValue ( '0201036c6e6402e501030a1042beb666ba043f72cb147adf3eaafc9e1201301a160a076164647265737312047265616' ) ;
96
- expect ( screen . queryByTestId ( 'client-cert' ) ) . not . toBeInTheDocument ( ) ;
97
- expect ( screen . queryByTestId ( 'ca-cert ') ) . not . toBeInTheDocument ( ) ;
98
- expect ( screen . getByTestId ( 'connect-url' ) ) . toHaveValue ( 'c-lightning-rest ://http://oqaer4kd7ufryngx6dsztovs4pnlmaouwmtkofjsd2m7pkq8wd.onion:3001?macaroon=0201036c6e6402e501030a1042beb666ba043f72cb147adf3eaafc9e1201301a160a076164647265737312047265616&protocol=http' ) ;
99
- expect ( screen . queryByTestId ( 'invoice-rune' ) ) . not . toBeInTheDocument ( ) ;
102
+ expect ( screen . queryByTestId ( 'client-key ') ) . toBeInTheDocument ( ) ;
103
+ expect ( screen . queryByTestId ( 'client-cert' ) ) . toBeInTheDocument ( ) ;
104
+ expect ( screen . getByTestId ( 'connect-url ') ) . toHaveValue (
105
+ 'clnrest ://https:// http://oqaer4kd7ufryngx6dsztovs4pnlmaouwmtkofjsd2m7pkq8wd.onion:3001?clientKey=ClientKey&clientCert=ClientCert&caCert=CACert' ,
106
+ ) ;
100
107
} ) ;
101
108
102
109
it ( 'updates selected network and input fields on network change to gRPC' , async ( ) => {
@@ -107,13 +114,12 @@ describe('ConnectWallet component ', () => {
107
114
const restNetworkItem = screen . getAllByTestId ( 'network-item' ) [ 4 ] ;
108
115
await act ( async ( ) => fireEvent . click ( restNetworkItem ) ) ;
109
116
110
- expect ( screen . getByTestId ( 'port' ) ) . toHaveValue ( '2106' ) ;
117
+ expect ( screen . getAllByTestId ( 'port' ) [ 1 ] ) . toHaveValue ( '2106' ) ;
111
118
expect ( screen . getByTestId ( 'host' ) ) . toHaveValue ( 'user.local' ) ;
112
- expect ( screen . getByTestId ( 'macaroon' ) ) . toHaveValue ( 'ClientKey' ) ;
113
- expect ( screen . getByTestId ( 'client-cert' ) ) . toHaveValue ( 'ClientCert' ) ;
114
- expect ( screen . getByTestId ( 'ca-cert' ) ) . toHaveValue ( 'CACert' ) ;
115
- expect ( screen . getByTestId ( 'connect-url' ) ) . toHaveValue ( 'cln-grpc://user.local:2106?clientkey=ClientKey&clientCert=ClientCert&caCert=CACert' ) ;
116
- expect ( screen . queryByTestId ( 'invoice-rune' ) ) . not . toBeInTheDocument ( ) ;
119
+ expect ( screen . queryByTestId ( 'client-key' ) ) . not . toBeInTheDocument ( ) ;
120
+ expect ( screen . queryByTestId ( 'client-cert' ) ) . not . toBeInTheDocument ( ) ;
121
+ expect ( screen . queryByTestId ( 'ca-cert' ) ) . not . toBeInTheDocument ( ) ;
122
+ expect ( screen . getByTestId ( 'connect-url' ) ) . toHaveValue ( 'cln-grpc://http://user.local:2106' ) ;
117
123
} ) ;
118
124
119
125
it ( 'updates selected network and input fields on network change to gRPC (Tor)' , async ( ) => {
@@ -123,13 +129,14 @@ describe('ConnectWallet component ', () => {
123
129
await act ( async ( ) => fireEvent . click ( screen . getByTestId ( 'network-toggle' ) ) ) ;
124
130
const restNetworkItem = screen . getAllByTestId ( 'network-item' ) [ 5 ] ;
125
131
await act ( async ( ) => fireEvent . click ( restNetworkItem ) ) ;
126
- expect ( screen . getByTestId ( 'port' ) ) . toHaveValue ( '2106' ) ;
127
- expect ( screen . getByTestId ( 'host' ) ) . toHaveValue ( 'oqaer4kd7ufryngx6dsztovs4pnlmaouwmtkofjsd2m7pkq8wd.onion' ) ;
128
- expect ( screen . getByTestId ( 'macaroon ') ) . toHaveValue ( 'ClientKey' ) ;
129
- expect ( screen . getByTestId ( 'client-cert' ) ) . toHaveValue ( 'ClientCert' ) ;
132
+ expect ( screen . getAllByTestId ( 'port' ) [ 1 ] ) . toHaveValue ( '2106' ) ;
133
+ expect ( screen . getByTestId ( 'host' ) ) . toHaveValue ( 'http:// oqaer4kd7ufryngx6dsztovs4pnlmaouwmtkofjsd2m7pkq8wd.onion' ) ;
134
+ expect ( screen . queryByTestId ( 'client-key ') ) . not . toBeInTheDocument ( ) ;
135
+ expect ( screen . queryByTestId ( 'client-cert' ) ) . not . toBeInTheDocument ( ) ;
130
136
expect ( screen . queryByTestId ( 'ca-cert' ) ) . not . toBeInTheDocument ( ) ;
131
- expect ( screen . getByTestId ( 'connect-url' ) ) . toHaveValue ( 'cln-grpc://oqaer4kd7ufryngx6dsztovs4pnlmaouwmtkofjsd2m7pkq8wd.onion:2106?clientkey=ClientKey&clientCert=ClientCert' ) ;
132
- expect ( screen . queryByTestId ( 'invoice-rune' ) ) . not . toBeInTheDocument ( ) ;
137
+ expect ( screen . getByTestId ( 'connect-url' ) ) . toHaveValue (
138
+ 'cln-grpc://http://http://oqaer4kd7ufryngx6dsztovs4pnlmaouwmtkofjsd2m7pkq8wd.onion:2106' ,
139
+ ) ;
133
140
} ) ;
134
141
135
142
it ( 'when creating an invoice rune, display loading spinner' , async ( ) => {
0 commit comments