-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #205 from atlassian/ARC-2584-consume-new-data
Arc-2584 consume new data
- Loading branch information
Showing
10 changed files
with
325 additions
and
77 deletions.
There are no files selected for viewing
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
74 changes: 74 additions & 0 deletions
74
app/jenkins-for-jira-ui/src/components/ConnectionPanel/SetUpGuide.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,74 @@ | ||
import React from 'react'; | ||
import { render } from '@testing-library/react'; | ||
import { PipelineEventType, SetUpGuideInstructions, SetUpGuideLink } from './SetUpGuide'; | ||
|
||
describe('SetUpGuideInstructions', () => { | ||
const onClickMock = jest.fn(); | ||
|
||
test('renders SetUpGuideInstructions with BUILD eventType, globalSettings, and regex', () => { | ||
const { getByText } = render( | ||
<SetUpGuideInstructions | ||
onClick={onClickMock} | ||
eventType={PipelineEventType?.BUILD} | ||
globalSettings | ||
regex="^build$" | ||
/> | ||
); | ||
|
||
expect(getByText('jiraSendBuildInfo')).toBeInTheDocument(); | ||
expect(getByText('OR')).toBeInTheDocument(); | ||
expect(getByText('^build$')).toBeInTheDocument(); | ||
}); | ||
|
||
test('renders SetUpGuideInstructions with BUILD eventType, globalSettings, and no regex', () => { | ||
const { getByText } = render( | ||
<SetUpGuideInstructions | ||
onClick={onClickMock} | ||
eventType={PipelineEventType?.BUILD} | ||
globalSettings | ||
/> | ||
); | ||
|
||
expect(getByText('No setup required')).toBeInTheDocument(); | ||
}); | ||
|
||
test('renders SetUpGuideInstructions with DEPLOYMENT eventType, globalSettings, and regex', () => { | ||
const { getByText } = render( | ||
<SetUpGuideInstructions | ||
onClick={onClickMock} | ||
eventType={PipelineEventType?.DEPLOYMENT} | ||
globalSettings | ||
regex="^deploy to (?<envName>.*)$" | ||
/> | ||
); | ||
|
||
expect(getByText('jiraSendDeploymentInfo')).toBeInTheDocument(); | ||
expect(getByText('OR')).toBeInTheDocument(); | ||
expect(getByText('^deploy to (?<envName>.*)$')).toBeInTheDocument(); | ||
}); | ||
|
||
test('renders SetUpGuideInstructions with DEPLOYMENT eventType, globalSettings set to false', () => { | ||
const { getByText, queryByText } = render( | ||
<SetUpGuideInstructions | ||
onClick={onClickMock} | ||
eventType={PipelineEventType?.DEPLOYMENT} | ||
globalSettings={false} | ||
/> | ||
); | ||
|
||
expect(getByText('jiraSendDeploymentInfo')).toBeInTheDocument(); | ||
expect(queryByText('OR')).toBeNull(); | ||
}); | ||
}); | ||
|
||
describe('SetUpGuideLink', () => { | ||
const onClickMock = jest.fn(); | ||
|
||
test('renders SetUpGuideLink with label', () => { | ||
const { getByText } = render( | ||
<SetUpGuideLink onClick={onClickMock} label="build" /> | ||
); | ||
|
||
expect(getByText('build')).toBeInTheDocument(); | ||
}); | ||
}); |
Oops, something went wrong.