Commit 070540ae authored by Kushal Pandya's avatar Kushal Pandya

Merge branch 'sidebar-button-migration' into 'master'

Turns the view more participants button into a gl-button

See merge request gitlab-org/gitlab!84725
parents 4cffc487 58f73094
<script> <script>
import { GlIcon, GlLoadingIcon, GlTooltipDirective } from '@gitlab/ui'; import { GlButton, GlIcon, GlLoadingIcon, GlTooltipDirective } from '@gitlab/ui';
import { __, n__, sprintf } from '~/locale'; import { __, n__, sprintf } from '~/locale';
import userAvatarImage from '~/vue_shared/components/user_avatar/user_avatar_image.vue'; import userAvatarImage from '~/vue_shared/components/user_avatar/user_avatar_image.vue';
...@@ -8,9 +8,10 @@ export default { ...@@ -8,9 +8,10 @@ export default {
GlTooltip: GlTooltipDirective, GlTooltip: GlTooltipDirective,
}, },
components: { components: {
userAvatarImage, GlButton,
GlIcon, GlIcon,
GlLoadingIcon, GlLoadingIcon,
userAvatarImage,
}, },
props: { props: {
loading: { loading: {
...@@ -124,9 +125,13 @@ export default { ...@@ -124,9 +125,13 @@ export default {
</div> </div>
</div> </div>
<div v-if="hasMoreParticipants" class="participants-more hide-collapsed"> <div v-if="hasMoreParticipants" class="participants-more hide-collapsed">
<button type="button" class="btn-transparent btn-link" @click="toggleMoreParticipants"> <gl-button
{{ toggleLabel }} variant="link"
</button> button-text-classes="gl-text-secondary"
data-testid="more-participants"
@click="toggleMoreParticipants"
>{{ toggleLabel }}</gl-button
>
</div> </div>
</div> </div>
</template> </template>
...@@ -17,8 +17,7 @@ const PARTICIPANT_LIST = [PARTICIPANT, { ...PARTICIPANT, id: 2 }, { ...PARTICIPA ...@@ -17,8 +17,7 @@ const PARTICIPANT_LIST = [PARTICIPANT, { ...PARTICIPANT, id: 2 }, { ...PARTICIPA
describe('Participants', () => { describe('Participants', () => {
let wrapper; let wrapper;
const getMoreParticipantsButton = () => wrapper.find('button'); const getMoreParticipantsButton = () => wrapper.find('[data-testid="more-participants"]');
const getCollapsedParticipantsCount = () => wrapper.find('[data-testid="collapsed-count"]'); const getCollapsedParticipantsCount = () => wrapper.find('[data-testid="collapsed-count"]');
const mountComponent = (propsData) => const mountComponent = (propsData) =>
...@@ -167,7 +166,7 @@ describe('Participants', () => { ...@@ -167,7 +166,7 @@ describe('Participants', () => {
expect(wrapper.vm.isShowingMoreParticipants).toBe(false); expect(wrapper.vm.isShowingMoreParticipants).toBe(false);
getMoreParticipantsButton().trigger('click'); getMoreParticipantsButton().vm.$emit('click');
expect(wrapper.vm.isShowingMoreParticipants).toBe(true); expect(wrapper.vm.isShowingMoreParticipants).toBe(true);
}); });
......
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