Skip to content

Commit 71b34f6

Browse files
authored
RI-6919: Enhance JSON input for RDI Dry run (#5074)
1 parent 5dd7112 commit 71b34f6

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

redisinsight/ui/src/pages/rdi/pipeline-management/components/jobs-panel/Panel.spec.tsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,12 @@ describe('JobsPanel', () => {
4343
expect(render(<JobsPanel {...instance(mockedProps)} />)).toBeTruthy()
4444
})
4545

46+
it('should have default value', () => {
47+
render(<JobsPanel {...instance(mockedProps)} />)
48+
49+
expect(screen.getByTestId('input-value')).toHaveValue('{\n}')
50+
})
51+
4652
it('should call onClose', () => {
4753
const mockOnClose = jest.fn()
4854
render(<JobsPanel {...instance(mockedProps)} onClose={mockOnClose} />)
@@ -54,7 +60,7 @@ describe('JobsPanel', () => {
5460
it('should render run btn with proper properties', () => {
5561
render(<JobsPanel {...instance(mockedProps)} />)
5662

57-
expect(screen.getByTestId('dry-run-btn')).toBeDisabled()
63+
expect(screen.getByTestId('dry-run-btn')).not.toBeDisabled()
5864

5965
// set invalid json value
6066
fireEvent.change(screen.getByTestId('input-value'), {

redisinsight/ui/src/pages/rdi/pipeline-management/components/jobs-panel/Panel.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ const DryRunJobPanel = (props: Props) => {
6262
const [selectedTab, changeSelectedTab] = useState<PipelineJobsTabs>(
6363
PipelineJobsTabs.Transformations,
6464
)
65-
const [input, setInput] = useState<string>('')
65+
const [input, setInput] = useState<string>('{\n}')
6666
const [isFormValid, setIsFormValid] = useState<boolean>(false)
6767
const [targetOptions, setTargetOptions] = useState<RiSelectOption[]>([])
6868
const [selectedTarget, setSelectedTarget] = useState<string>()
@@ -224,7 +224,7 @@ const DryRunJobPanel = (props: Props) => {
224224
</div>
225225
<div className={styles.body}>
226226
<Text className={styles.text}>
227-
Add input data to test the transformation logic.
227+
Add input data in JSON format to test the transformation logic.
228228
</Text>
229229
<div className={styles.codeLabel}>
230230
<Text>Input</Text>

0 commit comments

Comments
 (0)