File tree Expand file tree Collapse file tree 2 files changed +15
-1
lines changed
redisinsight/ui/src/components/keys-summary Expand file tree Collapse file tree 2 files changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -24,6 +24,20 @@ describe('KeysSummary', () => {
24
24
expect ( queryByTestId ( 'keys-summary' ) ) . toBeInTheDocument ( )
25
25
} )
26
26
27
+ it ( 'should Keys summary show proper text with count = 1' , ( ) => {
28
+ const { queryByTestId } = render (
29
+ < KeysSummary { ...instance ( mockedProps ) } scanned = { 1 } items = { [ { } ] } totalItemsCount = { 1 } />
30
+ )
31
+ expect ( queryByTestId ( 'keys-summary' ) ) . toHaveTextContent ( 'Results: 1 key.' )
32
+ } )
33
+
34
+ it ( 'should Keys summary show proper text with count > 1' , ( ) => {
35
+ const { queryByTestId } = render (
36
+ < KeysSummary { ...instance ( mockedProps ) } scanned = { 2 } items = { [ { } , { } ] } totalItemsCount = { 2 } />
37
+ )
38
+ expect ( queryByTestId ( 'keys-summary' ) ) . toHaveTextContent ( 'Results: 2 keys.' )
39
+ } )
40
+
27
41
it ( 'should not render Scan more button if showScanMore = false ' , ( ) => {
28
42
const { queryByTestId } = render (
29
43
< KeysSummary { ...instance ( mockedProps ) } showScanMore = { false } />
Original file line number Diff line number Diff line change @@ -47,7 +47,7 @@ const KeysSummary = (props: Props) => {
47
47
< b >
48
48
{ 'Results: ' }
49
49
< span data-testid = "keys-number-of-results" > { numberWithSpaces ( resultsLength ) } </ span >
50
- { ` key${ resultsLength !== 1 && 's' } . ` }
50
+ { ` key${ resultsLength !== 1 ? 's' : ' '} . ` }
51
51
</ b >
52
52
< EuiTextColor color = "subdued" >
53
53
{ 'Scanned ' }
You can’t perform that action at this time.
0 commit comments