Commit 9deef4eb authored by Kev's avatar Kev

Fix user status text shows in pipeline header

parent 2ba756c4
...@@ -5,6 +5,7 @@ import { ...@@ -5,6 +5,7 @@ import {
GlSafeHtmlDirective, GlSafeHtmlDirective,
GlAvatarLink, GlAvatarLink,
GlAvatarLabeled, GlAvatarLabeled,
GlTooltip,
} from '@gitlab/ui'; } from '@gitlab/ui';
import { isGid, getIdFromGraphQLId } from '~/graphql_shared/utils'; import { isGid, getIdFromGraphQLId } from '~/graphql_shared/utils';
import { glEmojiTag } from '../../emoji'; import { glEmojiTag } from '../../emoji';
...@@ -26,6 +27,7 @@ export default { ...@@ -26,6 +27,7 @@ export default {
GlButton, GlButton,
GlAvatarLink, GlAvatarLink,
GlAvatarLabeled, GlAvatarLabeled,
GlTooltip,
}, },
directives: { directives: {
GlTooltip: GlTooltipDirective, GlTooltip: GlTooltipDirective,
......
import { GlButton, GlAvatarLink } from '@gitlab/ui'; import { GlButton, GlAvatarLink, GlTooltip } from '@gitlab/ui';
import { shallowMount } from '@vue/test-utils'; import { shallowMount } from '@vue/test-utils';
import { extendedWrapper } from 'helpers/vue_test_utils_helper'; import { extendedWrapper } from 'helpers/vue_test_utils_helper';
import CiIconBadge from '~/vue_shared/components/ci_badge_link.vue'; import CiIconBadge from '~/vue_shared/components/ci_badge_link.vue';
...@@ -32,6 +32,7 @@ describe('Header CI Component', () => { ...@@ -32,6 +32,7 @@ describe('Header CI Component', () => {
const findTimeAgo = () => wrapper.findComponent(TimeagoTooltip); const findTimeAgo = () => wrapper.findComponent(TimeagoTooltip);
const findUserLink = () => wrapper.findComponent(GlAvatarLink); const findUserLink = () => wrapper.findComponent(GlAvatarLink);
const findSidebarToggleBtn = () => wrapper.findComponent(GlButton); const findSidebarToggleBtn = () => wrapper.findComponent(GlButton);
const findStatusTooltip = () => wrapper.findComponent(GlTooltip);
const findActionButtons = () => wrapper.findByTestId('ci-header-action-buttons'); const findActionButtons = () => wrapper.findByTestId('ci-header-action-buttons');
const findHeaderItemText = () => wrapper.findByTestId('ci-header-item-text'); const findHeaderItemText = () => wrapper.findByTestId('ci-header-item-text');
...@@ -91,6 +92,21 @@ describe('Header CI Component', () => { ...@@ -91,6 +92,21 @@ describe('Header CI Component', () => {
}); });
}); });
describe('when the user has a status', () => {
const STATUS_MESSAGE = 'Working on exciting features...';
beforeEach(() => {
createComponent({
itemName: 'Pipeline',
user: { ...defaultProps.user, status: { message: STATUS_MESSAGE } },
});
});
it('renders a tooltip', () => {
expect(findStatusTooltip().text()).toBe(STATUS_MESSAGE);
});
});
describe('with data from GraphQL', () => { describe('with data from GraphQL', () => {
const userId = 1; const userId = 1;
......
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