Commit 8bd9940b authored by Jacques Erasmus's avatar Jacques Erasmus

Merge branch...

Merge branch '249594-vsa-project-search-should-differentiate-between-projects-with-the-same-name' into 'master'

Project search should differentiate between projects with the same name

See merge request gitlab-org/gitlab!45020
parents c9d88f57 ca726db0
......@@ -201,7 +201,10 @@ export default {
:src="project.avatarUrl"
shape="rect"
/>
{{ project.name }}
<div>
<div data-testid="project-name">{{ project.name }}</div>
<div class="gl-text-gray-500" data-testid="project-full-path">{{ project.fullPath }}</div>
</div>
</div>
</gl-dropdown-item>
<gl-dropdown-item v-show="noResultsAvailable" class="gl-pointer-events-none text-secondary">{{
......
---
title: Add project full path to analytics project dropdown filter
merge_request: 45020
author:
type: changed
......@@ -69,6 +69,11 @@ describe('ProjectsDropdownFilter component', () => {
const findDropdownButtonIdentIconAtIndex = index =>
findDropdownAtIndex(index).find('div.gl-avatar-identicon');
const findDropdownNameAtIndex = index =>
findDropdownAtIndex(index).find('[data-testid="project-name"');
const findDropdownFullPathAtIndex = index =>
findDropdownAtIndex(index).find('[data-testid="project-full-path"]');
const selectDropdownItemAtIndex = index =>
findDropdownAtIndex(index)
.find('button')
......@@ -137,10 +142,23 @@ describe('ProjectsDropdownFilter component', () => {
expect(findDropdownButtonAvatarAtIndex(0).exists()).toBe(true);
expect(findDropdownButtonIdentIconAtIndex(0).exists()).toBe(false);
});
it("renders an identicon when the project doesn't have an avatarUrl", () => {
expect(findDropdownButtonAvatarAtIndex(1).exists()).toBe(false);
expect(findDropdownButtonIdentIconAtIndex(1).exists()).toBe(true);
});
it('renders the project name', () => {
projects.forEach((project, index) => {
expect(findDropdownNameAtIndex(index).text()).toBe(project.name);
});
});
it('renders the project fullPath', () => {
projects.forEach((project, index) => {
expect(findDropdownFullPathAtIndex(index).text()).toBe(project.fullPath);
});
});
});
describe('on project click', () => {
......@@ -202,6 +220,18 @@ describe('ProjectsDropdownFilter component', () => {
expect(findDropdownButtonAvatarAtIndex(1).exists()).toBe(false);
expect(findDropdownButtonIdentIconAtIndex(1).exists()).toBe(true);
});
it('renders the project name', () => {
projects.forEach((project, index) => {
expect(findDropdownNameAtIndex(index).text()).toBe(project.name);
});
});
it('renders the project fullPath', () => {
projects.forEach((project, index) => {
expect(findDropdownFullPathAtIndex(index).text()).toBe(project.fullPath);
});
});
});
describe('on project click', () => {
......
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