Commit b91d3f8e authored by Kushal Pandya's avatar Kushal Pandya

Merge branch '223279-confidential-warning-doesnt-show-the-issuable-type' into 'master'

Resolve "Confidential warning doesnt show the issuable type"

See merge request gitlab-org/gitlab!34988
parents 60a366b0 327bc236
......@@ -8,16 +8,10 @@ function buildDocsLinkStart(path) {
return `<a href="${escape(path)}" target="_blank" rel="noopener noreferrer">`;
}
const NoteableType = {
Issue: 'issue',
Epic: 'epic',
MergeRequest: 'merge_request',
};
const NoteableTypeText = {
[NoteableType.Issue]: __('issue'),
[NoteableType.Epic]: __('epic'),
[NoteableType.MergeRequest]: __('merge request'),
Issue: __('issue'),
Epic: __('epic'),
MergeRequest: __('merge request'),
};
export default {
......@@ -39,7 +33,8 @@ export default {
noteableType: {
type: String,
required: false,
default: NoteableType.Issue,
// eslint-disable-next-line @gitlab/require-i18n-strings
default: 'Issue',
},
lockedNoteableDocsPath: {
type: String,
......
---
title: Fix confidential warning not showing the issuable type
merge_request: 34988
author:
type: fixed
......@@ -4,4 +4,4 @@
#js-vue-notes{ data: { notes_data: notes_data(@epic).to_json,
noteable_data: EpicSerializer.new(current_user: current_user).represent(@epic).to_json,
current_user_data: UserSerializer.new.represent(current_user, { only_path: true }, CurrentUserEntity).to_json,
noteable_type: 'epic' } }
noteable_type: 'Epic' } }
......@@ -60,9 +60,12 @@ describe('Issue Warning Component', () => {
});
});
it('renders information about confidential issue', () => {
it('renders information about confidential issue', async () => {
expect(findConfidentialBlock().exists()).toBe(true);
expect(findConfidentialBlock().element).toMatchSnapshot();
await wrapper.vm.$nextTick();
expect(findConfidentialBlock(wrapper).text()).toContain('This is a confidential issue.');
});
it('renders warning icon', () => {
......@@ -142,13 +145,13 @@ describe('Issue Warning Component', () => {
it('renders confidential & locked messages with noteable "epic"', async () => {
wrapperLocked.setProps({
noteableType: 'epic',
noteableType: 'Epic',
});
wrapperConfidential.setProps({
noteableType: 'epic',
noteableType: 'Epic',
});
wrapperLockedAndConfidential.setProps({
noteableType: 'epic',
noteableType: 'Epic',
});
await wrapperLocked.vm.$nextTick();
......@@ -167,13 +170,13 @@ describe('Issue Warning Component', () => {
it('renders confidential & locked messages with noteable "merge request"', async () => {
wrapperLocked.setProps({
noteableType: 'merge_request',
noteableType: 'MergeRequest',
});
wrapperConfidential.setProps({
noteableType: 'merge_request',
noteableType: 'MergeRequest',
});
wrapperLockedAndConfidential.setProps({
noteableType: 'merge_request',
noteableType: 'MergeRequest',
});
await wrapperLocked.vm.$nextTick();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment