-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update CLI Panel helpers for Redis 6.2 and modules (#40)
* Refactoring * Update commands
- Loading branch information
1 parent
9cfa659
commit cbb9687
Showing
17 changed files
with
259 additions
and
103 deletions.
There are no files selected for viewing
43 changes: 0 additions & 43 deletions
43
src/redis-cli-panel/components/auto-scrolling-text-area.test.tsx
This file was deleted.
Oops, something went wrong.
35 changes: 35 additions & 0 deletions
35
src/redis-cli-panel/components/auto-scrolling-text-area/auto-scrolling-text-area.test.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import React from 'react'; | ||
import { mount, shallow } from 'enzyme'; | ||
import { TextArea } from '@grafana/ui'; | ||
import { CLITextArea } from './auto-scrolling-text-area'; | ||
|
||
/** | ||
* CLI TextArea | ||
*/ | ||
describe('CLITextArea', () => { | ||
it('Should set scrollTop if autoScroll=true', () => { | ||
const wrapper = shallow<typeof CLITextArea>(<CLITextArea value="123" autoScroll />); | ||
jest.spyOn(wrapper.instance(), 'render'); | ||
const element = { | ||
scrollHeight: 0, | ||
scrollTop: 0, | ||
}; | ||
|
||
expect(element.scrollTop).toEqual(element.scrollHeight); | ||
}); | ||
|
||
it('Should pass props to Textarea', () => { | ||
const onChangeMock = jest.fn(); | ||
const value = '1234'; | ||
const wrapper = shallow(<CLITextArea value={value} onChange={onChangeMock} />); | ||
const testedComponent = wrapper.find(TextArea); | ||
expect(testedComponent.exists()).toBeTruthy(); | ||
expect(testedComponent.prop('value')).toEqual(value); | ||
expect(testedComponent.prop('onChange')).toEqual(onChangeMock); | ||
}); | ||
|
||
it('Should set ref', () => { | ||
const wrapper = mount<typeof CLITextArea>(<CLITextArea />); | ||
expect(wrapper.instance()).toBeTruthy(); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
src/redis-cli-panel/components/auto-scrolling-text-area/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export * from './auto-scrolling-text-area'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export * from './redis-cli-panel'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import { | ||
RedisAIHelp, | ||
RedisBloomHelp, | ||
RedisGearsHelp, | ||
RedisGraphHelp, | ||
RedisHelp, | ||
RedisJSONHelp, | ||
RedisSearchHelp, | ||
RedisTimeSeriesHelp, | ||
} from './help'; | ||
import { HelpCommand } from './types'; | ||
|
||
/** | ||
* Help for native redis commands and modules | ||
*/ | ||
export const Help: { [key: string]: HelpCommand } = { | ||
...RedisHelp, | ||
...RedisAIHelp, | ||
...RedisBloomHelp, | ||
...RedisGearsHelp, | ||
...RedisGraphHelp, | ||
...RedisJSONHelp, | ||
...RedisSearchHelp, | ||
...RedisTimeSeriesHelp, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.