Skip to content
代码片段 群组 项目
未验证 提交 a8112ed1 编辑于 作者: Alexander Turinske's avatar Alexander Turinske 提交者: GitLab
浏览文件

Merge branch '520754-policies-fix-specs-groups_toggle_list_spec' into 'master'

No related branches found
No related tags found
无相关合并请求
...@@ -6,8 +6,8 @@ describe('GroupsToggleList', () => { ...@@ -6,8 +6,8 @@ describe('GroupsToggleList', () => {
let wrapper; let wrapper;
const mockedGroups = [ const mockedGroups = [
{ id: 1, name: 'group 1' }, { id: 1, name: 'group 1', fullPath: 'fullPath1' },
{ id: 2, name: 'group 2' }, { id: 2, name: 'group 2', fullPath: 'fullPath2' },
]; ];
const mockedProjects = [ const mockedProjects = [
{ id: 1, name: 'project 1' }, { id: 1, name: 'project 1' },
...@@ -107,20 +107,22 @@ describe('GroupsToggleList', () => { ...@@ -107,20 +107,22 @@ describe('GroupsToggleList', () => {
}, },
}); });
expect(findGroupsList().findAllComponents(GlLink).at(0).props('href')).toBe( const groupLinks = findGroupsList().findAllComponents(GlLink);
mockedGroups[0].full_path,
expect(groupLinks.at(0).attributes('href')).toBe(
'http://test.host/groups/fullPath1/-/security/policies',
); );
expect(findGroupsList().findAllComponents(GlLink).at(1).props('href')).toBe( expect(groupLinks.at(1).attributes('href')).toBe(
mockedGroups[1].full_path, 'http://test.host/groups/fullPath2/-/security/policies',
); );
expect(findProjectsList().findAllComponents(GlLink).at(0).props('href')).toBe( expect(groupLinks.at(0).attributes('href')).toBe(
mockedProjects[0].full_path, 'http://test.host/groups/fullPath1/-/security/policies',
); );
expect(findProjectsList().findAllComponents(GlLink).at(1).props('href')).toBe( expect(groupLinks.at(1).attributes('href')).toBe(
mockedProjects[1].full_path, 'http://test.host/groups/fullPath2/-/security/policies',
); );
expect(findAllLinks()).toHaveLength(mockedGroups.length + mockedProjects.length); expect(findAllLinks()).toHaveLength(mockedGroups.length + mockedProjects.length);
......
0% 加载中 .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册