).toBeInTheDocument();
expect(ui.changelogRow('assign', 'luke.skywalker', 'darth.vader').get()).toBeInTheDocument();
});
+
+ it('should correctly render any code variants', () => {
+ const { ui } = getPageObject();
+ renderIssue({ issue: mockIssue(false, { codeVariants: ['variant 1', 'variant 2'] }) });
+ expect(ui.variants(2).get()).toBeInTheDocument();
+ expect(findTooltipWithContent('variant 1, variant 2', undefined, 'div')).toBeInTheDocument();
+ });
});
describe('updating', () => {
whyLink: byRole('link', { name: 'issue.why_this_issue.long' }),
checkbox: byRole('checkbox'),
issueMessageBtn: byRole('button', { name: 'This is an issue' }),
+ variants: (n: number) => byText(`issue.x_code_variants.${n}`),
// Changelog
toggleChangelogBtn: byRole('button', {
IssueType as IssueTypeEnum,
} from '../../../types/issues';
import { Issue, RawQuery } from '../../../types/types';
+import Tooltip from '../../controls/Tooltip';
import { updateIssue } from '../actions';
import IssueAssign from './IssueAssign';
import IssueCommentAction from './IssueCommentAction';
/>
)}
</div>
- <div className="list-inline">
+ <div className="display-flex-end list-inline">
+ {issue.codeVariants && issue.codeVariants.length > 0 && (
+ <div className="issue-meta">
+ <Tooltip overlay={issue.codeVariants.join(', ')}>
+ <span className="issue-meta-label">
+ {issue.codeVariants.length > 1
+ ? translateWithParameters('issue.x_code_variants', issue.codeVariants.length)
+ : translate('issue.1_code_variant')}
+ </span>
+ </Tooltip>
+ </div>
+ )}
<div className="issue-meta js-issue-tags">
<IssueTags
canSetTags={canSetTags}
}
/* eslint-enable testing-library/no-node-access */
-export function findTooltipWithContent(text: Matcher, target?: HTMLElement) {
+export function findTooltipWithContent(
+ text: Matcher,
+ target?: HTMLElement,
+ selector = 'svg > desc'
+) {
return target
- ? within(target).getByText(text, { selector: 'svg > desc' })
- : screen.getByText(text, { selector: 'svg > desc' });
+ ? within(target).getByText(text, { selector })
+ : screen.getByText(text, { selector });
}
issue.action.permalink=Get permalink
issue.effort=Effort:
issue.x_effort={0} effort
+issue.1_code_variant=1 variant
+issue.x_code_variants={0} variants
issue.filter_similar_issues=Filter Similar Issues
issue.this_issue_involves_x_code_locations=This issue involves {0} code location(s)
issue.this_flow_involves_x_code_locations=This flow involves {0} code location(s)
issue.changelog.field.effort=Effort
issue.changelog.field.status=Status
issue.changelog.field.tags=Tags
+issue.changelog.field.code_variants=Code Variants
issue.changelog.field.type=Type
issue.changelog.field.file=File