File tree Expand file tree Collapse file tree 3 files changed +11
-11
lines changed
redisinsight/ui/src/pages/browser/modules/key-details/components
hash-details/hash-details-table
list-details/list-details-table Expand file tree Collapse file tree 3 files changed +11
-11
lines changed Original file line number Diff line number Diff line change @@ -113,17 +113,17 @@ describe('HashDetailsTable', () => {
113
113
114
114
it ( 'edit button should be disabled if data was compressed' , async ( ) => {
115
115
const defaultState = jest . requireActual ( 'uiSrc/slices/browser/hash' ) . initialState
116
- const hashDataSelectorMock = jest . fn ( ) . mockReturnValue ( {
116
+ const hashDataSelectorMock = jest . fn ( ) . mockReturnValueOnce ( {
117
117
...defaultState ,
118
118
total : 1 ,
119
119
key : '123zxczxczxc' ,
120
120
fields : [
121
121
{ field : anyToBuffer ( GZIP_COMPRESSED_VALUE_1 ) , value : anyToBuffer ( GZIP_COMPRESSED_VALUE_2 ) } ,
122
122
]
123
123
} ) ;
124
- ( hashDataSelector as jest . Mock ) . mockImplementation ( hashDataSelectorMock ) ;
124
+ ( hashDataSelector as jest . Mock ) . mockImplementationOnce ( hashDataSelectorMock ) ;
125
125
126
- ( connectedInstanceSelector as jest . Mock ) . mockImplementation ( ( ) => ( {
126
+ ( connectedInstanceSelector as jest . Mock ) . mockImplementationOnce ( ( ) => ( {
127
127
compressor : KeyValueCompressor . GZIP ,
128
128
} ) )
129
129
@@ -149,7 +149,7 @@ describe('HashDetailsTable', () => {
149
149
const afterRenderActions = [ ...store . getActions ( ) ]
150
150
151
151
await act ( ( ) => {
152
- fireEvent . click ( screen . getByTestId ( ' edit-hash-button-2' ) )
152
+ fireEvent . click ( screen . queryAllByTestId ( / e d i t - h a s h - b u t t o n / ) [ 0 ] )
153
153
} )
154
154
155
155
expect ( store . getActions ( ) ) . toEqual ( [
Original file line number Diff line number Diff line change @@ -110,16 +110,16 @@ describe('ListDetailsTable', () => {
110
110
111
111
it ( 'edit button should be disabled if data was compressed' , async ( ) => {
112
112
const defaultState = jest . requireActual ( 'uiSrc/slices/browser/list' ) . initialState
113
- const listDataSelectorMock = jest . fn ( ) . mockReturnValue ( {
113
+ const listDataSelectorMock = jest . fn ( ) . mockReturnValueOnce ( {
114
114
...defaultState ,
115
115
key : '123zxczxczxc' ,
116
116
elements : [
117
117
{ element : anyToBuffer ( GZIP_COMPRESSED_VALUE_1 ) , index : 0 } ,
118
118
]
119
119
} ) ;
120
- ( listDataSelector as jest . Mock ) . mockImplementation ( listDataSelectorMock ) ;
120
+ ( listDataSelector as jest . Mock ) . mockImplementationOnce ( listDataSelectorMock ) ;
121
121
122
- ( connectedInstanceSelector as jest . Mock ) . mockImplementation ( ( ) => ( {
122
+ ( connectedInstanceSelector as jest . Mock ) . mockImplementationOnce ( ( ) => ( {
123
123
compressor : KeyValueCompressor . GZIP ,
124
124
} ) )
125
125
Original file line number Diff line number Diff line change @@ -58,13 +58,13 @@ describe('StringDetails', () => {
58
58
} )
59
59
60
60
it ( 'should not be able to change value (long string not fully load)' , ( ) => {
61
- const stringDataSelectorMock = jest . fn ( ) . mockReturnValue ( {
61
+ const stringDataSelectorMock = jest . fn ( ) . mockReturnValueOnce ( {
62
62
value : {
63
63
type : 'Buffer' ,
64
64
data : [ 49 , 50 , 51 ] ,
65
65
}
66
66
} ) ;
67
- ( stringDataSelector as jest . Mock ) . mockImplementation ( stringDataSelectorMock )
67
+ ( stringDataSelector as jest . Mock ) . mockImplementationOnce ( stringDataSelectorMock )
68
68
69
69
render (
70
70
< StringDetails
@@ -77,10 +77,10 @@ describe('StringDetails', () => {
77
77
} )
78
78
79
79
it ( 'should not be able to change value (compressed)' , ( ) => {
80
- const stringSelectorMock = jest . fn ( ) . mockReturnValue ( {
80
+ const stringSelectorMock = jest . fn ( ) . mockReturnValueOnce ( {
81
81
isCompressed : true
82
82
} ) ;
83
- ( stringSelector as jest . Mock ) . mockImplementation ( stringSelectorMock )
83
+ ( stringSelector as jest . Mock ) . mockImplementationOnce ( stringSelectorMock )
84
84
85
85
render (
86
86
< StringDetails
You can’t perform that action at this time.
0 commit comments