From 9575288f6259e37726c61451478b9c7d5a73b843 Mon Sep 17 00:00:00 2001 From: Arun Kumar Mohan Date: Wed, 28 Aug 2019 05:20:30 -0500 Subject: [PATCH] Refactor showStagedIcon property's behavior to match its name Previously, the `showStagedIcon` property was doing the opposite of what its name suggested. It was rendering the staged icon when `showStagedIcon` was `false` and rendering the regular icon when it was `true`. --- app/assets/javascripts/ide/components/file_row_extra.vue | 2 +- .../javascripts/vue_shared/components/changed_file_icon.vue | 4 ++-- changelogs/unreleased/refactor-showStagedIcon.yml | 5 +++++ .../vue_shared/components/changed_file_icon_spec.js | 6 ++---- 4 files changed, 10 insertions(+), 7 deletions(-) create mode 100644 changelogs/unreleased/refactor-showStagedIcon.yml diff --git a/app/assets/javascripts/ide/components/file_row_extra.vue b/app/assets/javascripts/ide/components/file_row_extra.vue index 7254c50a568..48be97c8952 100644 --- a/app/assets/javascripts/ide/components/file_row_extra.vue +++ b/app/assets/javascripts/ide/components/file_row_extra.vue @@ -86,7 +86,7 @@ export default { v-else-if="showChangedFileIcon" :file="file" :show-tooltip="true" - :show-staged-icon="true" + :show-staged-icon="false" /> { expect(findIcon().props('size')).toBe(size); }); - // NOTE: It looks like 'showStagedIcon' behavior is backwards to what the name suggests - // https://gitlab.com/gitlab-org/gitlab-ce/issues/66071 it.each` showStagedIcon | iconName | desc - ${false} | ${'file-modified-solid'} | ${'with showStagedIcon false, renders staged icon'} - ${true} | ${'file-modified'} | ${'with showStagedIcon true, renders regular icon'} + ${true} | ${'file-modified-solid'} | ${'with showStagedIcon true, renders staged icon'} + ${false} | ${'file-modified'} | ${'with showStagedIcon false, renders regular icon'} `('$desc', ({ showStagedIcon, iconName }) => { factory({ file: stagedFile(),