File tree Expand file tree Collapse file tree 2 files changed +14
-6
lines changed Expand file tree Collapse file tree 2 files changed +14
-6
lines changed Original file line number Diff line number Diff line change @@ -40,4 +40,15 @@ describe('NetworkHttp', () => {
4040 } ) ;
4141 } ) ;
4242 } ) ;
43+
44+ describe ( 'getNetworkName' , ( ) => {
45+ it ( 'should return network name and description' , ( done ) => {
46+ networkHttp . getNetworkName ( )
47+ . subscribe ( ( networkName ) => {
48+ expect ( networkName . name . toLowerCase ( ) ) . to . be . equal ( 'mijintest' ) ;
49+ expect ( networkName . description . toLowerCase ( ) ) . to . be . equal ( 'catapult development network' ) ;
50+ done ( ) ;
51+ } ) ;
52+ } ) ;
53+ } ) ;
4354} ) ;
Original file line number Diff line number Diff line change @@ -57,9 +57,7 @@ export class NetworkHttp extends Http implements NetworkRepository {
5757 */
5858 public getNetworkType ( ) : Observable < NetworkType > {
5959 return observableFrom ( this . nodeHttp . getNodeInfo ( ) ) . pipe (
60- map ( ( ( nodeInfo : NodeInfo ) => {
61- return nodeInfo . networkIdentifier ;
62- } ) ,
60+ map ( ( ( nodeInfo : NodeInfo ) => nodeInfo . networkIdentifier ) ,
6361 catchError ( ( error ) => throwError ( this . errorHandling ( error ) ) ) ) ,
6462 ) ;
6563 }
@@ -71,9 +69,8 @@ export class NetworkHttp extends Http implements NetworkRepository {
7169 */
7270 public getNetworkName ( ) : Observable < NetworkName > {
7371 return observableFrom ( this . networkRouteApi . getNetworkType ( ) ) . pipe (
74- map ( ( response : { response : ClientResponse ; body : NetworkTypeDTO ; } ) => {
75- return new NetworkName ( response . body . name , response . body . description ) ;
76- } ) ,
72+ map ( ( response : { response : ClientResponse ; body : NetworkTypeDTO ; } ) =>
73+ new NetworkName ( response . body . name , response . body . description ) ) ,
7774 catchError ( ( error ) => throwError ( this . errorHandling ( error ) ) ) ,
7875 ) ;
7976 }
You can’t perform that action at this time.
0 commit comments