BigW Consortium Gitlab

Commit 3417e97c by Regis

fix a few tests (not all) - update title in tab with new issue

parent 76cdb8ee
......@@ -68,6 +68,8 @@ export default {
this.timeoutId = setTimeout(() => {
this.title = title;
document.querySelector('title').innerText = title;
this.description = description;
elementsToVisualize.forEach((element) => {
......@@ -98,13 +100,15 @@ export default {
});
},
updated() {
new gl.TaskList({
const tl = new gl.TaskList({
dataType: 'issue',
fieldName: 'description',
selector: '.detail-page-description',
}).init();
});
$(this.$refs['issue-content-container-gfm-entry']).renderGFM();
return tl;
},
};
</script>
......
......@@ -63,12 +63,16 @@ feature 'Task Lists', feature: true do
end
describe 'for Issues' do
describe 'multiple tasks' do
include WaitForVueResource
describe 'multiple tasks', js: true do
let!(:issue) { create(:issue, description: markdown, author: user, project: project) }
it 'renders' do
visit_issue(project, issue)
wait_for_vue_resource
expect(page).to have_selector('ul.task-list', count: 1)
expect(page).to have_selector('li.task-list-item', count: 6)
expect(page).to have_selector('ul input[checked]', count: 2)
......@@ -79,6 +83,8 @@ feature 'Task Lists', feature: true do
container = '.detail-page-description .description.js-task-list-container'
wait_for_vue_resource
expect(page).to have_selector(container)
expect(page).to have_selector("#{container} .wiki .task-list .task-list-item .task-list-item-checkbox")
expect(page).to have_selector("#{container} .js-task-list-field")
......@@ -88,12 +94,17 @@ feature 'Task Lists', feature: true do
it 'is only editable by author' do
visit_issue(project, issue)
wait_for_vue_resource
expect(page).to have_selector('.js-task-list-container')
logout(:user)
login_as(user2)
visit current_path
wait_for_vue_resource
expect(page).not_to have_selector('.js-task-list-container')
end
......@@ -109,6 +120,8 @@ feature 'Task Lists', feature: true do
it 'renders' do
visit_issue(project, issue)
wait_for_vue_resource
expect(page).to have_selector('ul.task-list', count: 1)
expect(page).to have_selector('li.task-list-item', count: 1)
expect(page).to have_selector('ul input[checked]', count: 0)
......@@ -126,6 +139,8 @@ feature 'Task Lists', feature: true do
it 'renders' do
visit_issue(project, issue)
wait_for_vue_resource
expect(page).to have_selector('ul.task-list', count: 1)
expect(page).to have_selector('li.task-list-item', count: 1)
expect(page).to have_selector('ul input[checked]', count: 1)
......@@ -143,6 +158,9 @@ feature 'Task Lists', feature: true do
before { visit_issue(project, issue) }
it 'renders' do
wait_for_vue_resource
expect(page).to have_selector('ul.task-list', count: 2)
expect(page).to have_selector('li.task-list-item', count: 7)
expect(page).to have_selector('ul input[checked]', count: 1)
......@@ -152,6 +170,8 @@ feature 'Task Lists', feature: true do
it 'solves tasks' do
expect(page).to have_content("2 of 7 tasks completed")
wait_for_vue_resource
page.find('li.task-list-item', text: 'Task b').find('input').click
page.find('li.task-list-item ul li.task-list-item', text: 'Task a.2').find('input').click
page.find('li.task-list-item ol li.task-list-item', text: 'Task 1.1').find('input').click
......@@ -160,6 +180,8 @@ feature 'Task Lists', feature: true do
visit_issue(project, issue) # reload to see new system notes
wait_for_vue_resource
expect(page).to have_content('marked the task Task b as complete')
expect(page).to have_content('marked the task Task a.2 as complete')
expect(page).to have_content('marked the task Task 1.1 as complete')
......
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