11import React from 'react' ;
22import * as LOOP from 'types/generated/loop_pb' ;
33import { fireEvent } from '@testing-library/react' ;
4- import { ellipseInside } from 'util/strings' ;
54import { renderWithProviders } from 'util/tests' ;
65import { loopListSwaps } from 'util/tests/sampleData' ;
76import { createStore , Store } from 'store' ;
@@ -49,7 +48,7 @@ describe('ProcessingSwaps component', () => {
4948 const { getByText, getByTitle } = render ( ) ;
5049 const swap = addSwap ( LOOP_IN , INITIATED ) ;
5150 expect ( getByText ( 'dot.svg' ) ) . toHaveClass ( 'warn' ) ;
52- expect ( getByText ( ellipseInside ( swap . id ) ) ) . toBeInTheDocument ( ) ;
51+ expect ( getByText ( swap . ellipsedId ) ) . toBeInTheDocument ( ) ;
5352 expect ( getByTitle ( swap . stateLabel ) ) . toBeInTheDocument ( ) ;
5453 expect ( width ( getByTitle ( swap . stateLabel ) ) ) . toBe ( '25%' ) ;
5554 } ) ;
@@ -58,7 +57,7 @@ describe('ProcessingSwaps component', () => {
5857 const { getByText, getByTitle } = render ( ) ;
5958 const swap = addSwap ( LOOP_IN , HTLC_PUBLISHED ) ;
6059 expect ( getByText ( 'dot.svg' ) ) . toHaveClass ( 'warn' ) ;
61- expect ( getByText ( ellipseInside ( swap . id ) ) ) . toBeInTheDocument ( ) ;
60+ expect ( getByText ( swap . ellipsedId ) ) . toBeInTheDocument ( ) ;
6261 expect ( getByTitle ( swap . stateLabel ) ) . toBeInTheDocument ( ) ;
6362 expect ( width ( getByTitle ( swap . stateLabel ) ) ) . toBe ( '50%' ) ;
6463 } ) ;
@@ -67,23 +66,23 @@ describe('ProcessingSwaps component', () => {
6766 const { getByText, getByTitle } = render ( ) ;
6867 const swap = addSwap ( LOOP_IN , INVOICE_SETTLED ) ;
6968 expect ( getByText ( 'dot.svg' ) ) . toHaveClass ( 'warn' ) ;
70- expect ( getByText ( ellipseInside ( swap . id ) ) ) . toBeInTheDocument ( ) ;
69+ expect ( getByText ( swap . ellipsedId ) ) . toBeInTheDocument ( ) ;
7170 expect ( getByTitle ( swap . stateLabel ) ) . toBeInTheDocument ( ) ;
7271 expect ( width ( getByTitle ( swap . stateLabel ) ) ) . toBe ( '75%' ) ;
7372 } ) ;
7473
7574 it ( 'should display an SUCCESS Loop In' , ( ) => {
7675 const { getByText, getByTitle } = render ( ) ;
7776 const swap = addSwap ( LOOP_IN , SUCCESS ) ;
78- expect ( getByText ( ellipseInside ( swap . id ) ) ) . toBeInTheDocument ( ) ;
77+ expect ( getByText ( swap . ellipsedId ) ) . toBeInTheDocument ( ) ;
7978 expect ( getByTitle ( swap . stateLabel ) ) . toBeInTheDocument ( ) ;
8079 expect ( width ( getByTitle ( swap . stateLabel ) ) ) . toBe ( '100%' ) ;
8180 } ) ;
8281
8382 it ( 'should display an FAILED Loop In' , ( ) => {
8483 const { getByText } = render ( ) ;
8584 const swap = addSwap ( LOOP_IN , FAILED ) ;
86- expect ( getByText ( ellipseInside ( swap . id ) ) ) . toBeInTheDocument ( ) ;
85+ expect ( getByText ( swap . ellipsedId ) ) . toBeInTheDocument ( ) ;
8786 expect ( getByText ( swap . stateLabel ) ) . toBeInTheDocument ( ) ;
8887 expect ( getByText ( 'close.svg' ) ) . toBeInTheDocument ( ) ;
8988 } ) ;
@@ -92,7 +91,7 @@ describe('ProcessingSwaps component', () => {
9291 const { getByText, getByTitle } = render ( ) ;
9392 const swap = addSwap ( LOOP_OUT , INITIATED ) ;
9493 expect ( getByText ( 'dot.svg' ) ) . toHaveClass ( 'warn' ) ;
95- expect ( getByText ( ellipseInside ( swap . id ) ) ) . toBeInTheDocument ( ) ;
94+ expect ( getByText ( swap . ellipsedId ) ) . toBeInTheDocument ( ) ;
9695 expect ( getByTitle ( swap . stateLabel ) ) . toBeInTheDocument ( ) ;
9796 expect ( width ( getByTitle ( swap . stateLabel ) ) ) . toBe ( '33%' ) ;
9897 } ) ;
@@ -101,7 +100,7 @@ describe('ProcessingSwaps component', () => {
101100 const { getByText, getByTitle } = render ( ) ;
102101 const swap = addSwap ( LOOP_OUT , PREIMAGE_REVEALED ) ;
103102 expect ( getByText ( 'dot.svg' ) ) . toHaveClass ( 'warn' ) ;
104- expect ( getByText ( ellipseInside ( swap . id ) ) ) . toBeInTheDocument ( ) ;
103+ expect ( getByText ( swap . ellipsedId ) ) . toBeInTheDocument ( ) ;
105104 expect ( getByTitle ( swap . stateLabel ) ) . toBeInTheDocument ( ) ;
106105 expect ( width ( getByTitle ( swap . stateLabel ) ) ) . toBe ( '66%' ) ;
107106 } ) ;
@@ -110,15 +109,15 @@ describe('ProcessingSwaps component', () => {
110109 const { getByText, getByTitle } = render ( ) ;
111110 const swap = addSwap ( LOOP_OUT , SUCCESS ) ;
112111 expect ( getByText ( 'dot.svg' ) ) . toHaveClass ( 'success' ) ;
113- expect ( getByText ( ellipseInside ( swap . id ) ) ) . toBeInTheDocument ( ) ;
112+ expect ( getByText ( swap . ellipsedId ) ) . toBeInTheDocument ( ) ;
114113 expect ( getByTitle ( swap . stateLabel ) ) . toBeInTheDocument ( ) ;
115114 expect ( width ( getByTitle ( swap . stateLabel ) ) ) . toBe ( '100%' ) ;
116115 } ) ;
117116
118117 it ( 'should display an FAILED Loop Out' , ( ) => {
119118 const { getByText } = render ( ) ;
120119 const swap = addSwap ( LOOP_OUT , FAILED ) ;
121- expect ( getByText ( ellipseInside ( swap . id ) ) ) . toBeInTheDocument ( ) ;
120+ expect ( getByText ( swap . ellipsedId ) ) . toBeInTheDocument ( ) ;
122121 expect ( getByText ( swap . stateLabel ) ) . toBeInTheDocument ( ) ;
123122 expect ( getByText ( 'close.svg' ) ) . toBeInTheDocument ( ) ;
124123 } ) ;
0 commit comments