blob: 1097582a8e9b4a6b3f2771511beff892adf728f5 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
|
//= require vue
//= require environments/components/environment_actions
describe('Actions Component', () => {
fixture.preload('environments/element.html');
beforeEach(() => {
fixture.load('environments/element.html');
});
it('Should render a dropdown with the provided actions', () => {
const actionsMock = [
{
name: 'bar',
play_url: 'https://gitlab.com/play',
},
{
name: 'foo',
play_url: '#',
},
];
const component = new window.gl.environmentsList.ActionsComponent({
el: document.querySelector('.test-dom-element'),
propsData: {
actions: actionsMock,
},
});
expect(
component.$el.querySelectorAll('.dropdown-menu li').length
).toEqual(actionsMock.length);
expect(
component.$el.querySelector('.dropdown-menu li a').getAttribute('href')
).toEqual(actionsMock[0].play_url);
});
});
|