Commit 4df7e5e3 authored by Simon Knox's avatar Simon Knox

update Edit button specs

parent f18d1da6
...@@ -153,10 +153,11 @@ describe 'Multiple Issue Boards', :js do ...@@ -153,10 +153,11 @@ describe 'Multiple Issue Boards', :js do
click_button board.name click_button board.name
page.within('.dropdown-menu') do page.within('.dropdown-menu') do
expect(page).to have_content('Edit board')
expect(page).not_to have_content('Create new board') expect(page).not_to have_content('Create new board')
expect(page).not_to have_content('Delete board') expect(page).not_to have_content('Delete board')
end end
expect(page).to have_content('Edit board')
end end
it 'shows a mention that boards are hidden when multiple boards are created' do it 'shows a mention that boards are hidden when multiple boards are created' do
......
...@@ -39,11 +39,10 @@ describe('LabelsSelect', () => { ...@@ -39,11 +39,10 @@ describe('LabelsSelect', () => {
setFixtures('<div class="test-container"></div>'); setFixtures('<div class="test-container"></div>');
const deferred = new jQuery.Deferred(); const deferred = new jQuery.Deferred();
spyOn($, 'ajax').and.returnValue(deferred); spyOn($, 'ajax').and.returnValue(deferred.resolve([
deferred.resolve([
label, label,
label2, label2,
]); ]));
// eslint-disable-next-line no-new // eslint-disable-next-line no-new
new IssuableContext(); new IssuableContext();
...@@ -64,13 +63,21 @@ describe('LabelsSelect', () => { ...@@ -64,13 +63,21 @@ describe('LabelsSelect', () => {
Vue.nextTick(done); Vue.nextTick(done);
}); });
describe('canEdit false', () => {
});
describe('canEdit', () => { describe('canEdit', () => {
it('shows edit link', () => { it('hides Edit button', (done) => {
vm.canEdit = false;
Vue.nextTick(() => {
expect(document.querySelector('.edit-link')).toBeFalsy();
done();
});
});
it('shows Edit button if true', (done) => {
vm.canEdit = true;
Vue.nextTick(() => {
expect(document.querySelector('.edit-link')).toBeTruthy();
done();
});
}); });
}); });
......
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