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
click_button board.name
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('Delete board')
end
expect(page).to have_content('Edit board')
end
it 'shows a mention that boards are hidden when multiple boards are created' do
......
......@@ -39,11 +39,10 @@ describe('LabelsSelect', () => {
setFixtures('<div class="test-container"></div>');
const deferred = new jQuery.Deferred();
spyOn($, 'ajax').and.returnValue(deferred);
deferred.resolve([
spyOn($, 'ajax').and.returnValue(deferred.resolve([
label,
label2,
]);
]));
// eslint-disable-next-line no-new
new IssuableContext();
......@@ -64,13 +63,21 @@ describe('LabelsSelect', () => {
Vue.nextTick(done);
});
describe('canEdit false', () => {
});
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