@@ -18,8 +18,10 @@ describe('ConnectWallet component ', () => {
1818 expect ( screen . getByText ( 'LN Message' ) ) . toBeInTheDocument ( ) ;
1919 expect ( screen . getByTestId ( 'port' ) ) . toHaveValue ( '5001' ) ;
2020 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+ ) ;
2325 expect ( screen . getByTestId ( 'invoice-rune' ) ) . toHaveValue ( 'aHFhnFyVWrRQChA9eJ01RQT9W502daqrP0JA4BiHHw89MCZGb3IgQXBwbGljYXRpb2==' ) ;
2426 expect ( screen . queryByTestId ( 'invoice-rune-spinner' ) ) . not . toBeInTheDocument ( ) ;
2527 } ) ;
@@ -41,10 +43,12 @@ describe('ConnectWallet component ', () => {
4143
4244 expect ( screen . getByTestId ( 'port' ) ) . toHaveValue ( '5001' ) ;
4345 expect ( screen . getByTestId ( 'host' ) ) . toHaveValue ( 'user.local' ) ;
44- expect ( screen . getByTestId ( 'macaroon ' ) ) . toHaveValue ( 'mRXhnFyVWrRQChA9eJ01RQT9W502daqrP0JA4BiHHw89MCZGb3IgQXBwbGljYXRpb24j' ) ;
46+ expect ( screen . getByTestId ( 'rune ' ) ) . toHaveValue ( 'mRXhnFyVWrRQChA9eJ01RQT9W502daqrP0JA4BiHHw89MCZGb3IgQXBwbGljYXRpb24j' ) ;
4547 expect ( screen . queryByTestId ( 'client-cert' ) ) . not . toBeInTheDocument ( ) ;
4648 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+ ) ;
4852 expect ( screen . getByTestId ( 'invoice-rune' ) ) . toHaveValue ( 'aHFhnFyVWrRQChA9eJ01RQT9W502daqrP0JA4BiHHw89MCZGb3IgQXBwbGljYXRpb2==' ) ;
4953 } ) ;
5054
@@ -57,11 +61,13 @@ describe('ConnectWallet component ', () => {
5761 await act ( async ( ) => fireEvent . click ( restNetworkItem ) ) ;
5862
5963 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' ) ;
6266 expect ( screen . queryByTestId ( 'client-cert' ) ) . not . toBeInTheDocument ( ) ;
6367 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+ ) ;
6571 expect ( screen . getByTestId ( 'invoice-rune' ) ) . toHaveValue ( 'aHFhnFyVWrRQChA9eJ01RQT9W502daqrP0JA4BiHHw89MCZGb3IgQXBwbGljYXRpb2==' ) ;
6672 } ) ;
6773
@@ -73,13 +79,14 @@ describe('ConnectWallet component ', () => {
7379 const restNetworkItem = screen . getAllByTestId ( 'network-item' ) [ 2 ] ;
7480 await act ( async ( ) => fireEvent . click ( restNetworkItem ) ) ;
7581
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+ ) ;
8390 } ) ;
8491
8592 it ( 'updates selected network and input fields on network change to REST (Tor)' , async ( ) => {
@@ -90,13 +97,13 @@ describe('ConnectWallet component ', () => {
9097 const restNetworkItem = screen . getAllByTestId ( 'network-item' ) [ 3 ] ;
9198 await act ( async ( ) => fireEvent . click ( restNetworkItem ) ) ;
9299
93- expect ( screen . getByTestId ( 'port' ) ) . toHaveValue ( '3001' ) ;
100+ expect ( screen . getAllByTestId ( 'port' ) [ 1 ] ) . toHaveValue ( '3001' ) ;
94101 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+ ) ;
100107 } ) ;
101108
102109 it ( 'updates selected network and input fields on network change to gRPC' , async ( ) => {
@@ -107,13 +114,12 @@ describe('ConnectWallet component ', () => {
107114 const restNetworkItem = screen . getAllByTestId ( 'network-item' ) [ 4 ] ;
108115 await act ( async ( ) => fireEvent . click ( restNetworkItem ) ) ;
109116
110- expect ( screen . getByTestId ( 'port' ) ) . toHaveValue ( '2106' ) ;
117+ expect ( screen . getAllByTestId ( 'port' ) [ 1 ] ) . toHaveValue ( '2106' ) ;
111118 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' ) ;
117123 } ) ;
118124
119125 it ( 'updates selected network and input fields on network change to gRPC (Tor)' , async ( ) => {
@@ -123,13 +129,14 @@ describe('ConnectWallet component ', () => {
123129 await act ( async ( ) => fireEvent . click ( screen . getByTestId ( 'network-toggle' ) ) ) ;
124130 const restNetworkItem = screen . getAllByTestId ( 'network-item' ) [ 5 ] ;
125131 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 ( ) ;
130136 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+ ) ;
133140 } ) ;
134141
135142 it ( 'when creating an invoice rune, display loading spinner' , async ( ) => {
0 commit comments