Commit f62aa64b authored by Phil Hughes's avatar Phil Hughes

Merge branch 'update-todo-in-ui' into 'master'

Change "Todo" to "To Do" in UI

Closes #61501

See merge request gitlab-org/gitlab-ce!28844
parents 54ced8d5 c433082f
......@@ -82,7 +82,7 @@ export default class Todos {
})
.catch(() => {
this.updateRowState(target, true);
return flash(__('Error updating todo status.'));
return flash(__('Error updating status of to-do item.'));
});
}
......@@ -124,7 +124,7 @@ export default class Todos {
this.updateAllState(target, data);
this.updateBadges(data);
})
.catch(() => flash(__('Error updating status for all todos.')));
.catch(() => flash(__('Error updating status for all to-do items.')));
}
updateAllState(target, data) {
......
......@@ -5,8 +5,8 @@ import { GlLoadingIcon } from '@gitlab/ui';
import Icon from '~/vue_shared/components/icon.vue';
const MARK_TEXT = __('Mark todo as done');
const TODO_TEXT = __('Add todo');
const MARK_TEXT = __('Mark as done');
const TODO_TEXT = __('Add a To Do');
export default {
directives: {
......
......@@ -22,7 +22,7 @@ class Dashboard::TodosController < Dashboard::ApplicationController
format.html do
redirect_to dashboard_todos_path,
status: 302,
notice: _('Todo was successfully marked as done.')
notice: _('To-do item successfully marked as done.')
end
format.js { head :ok }
format.json { render json: todos_counts }
......@@ -33,7 +33,7 @@ class Dashboard::TodosController < Dashboard::ApplicationController
updated_ids = TodoService.new.mark_todos_as_done(@todos, current_user)
respond_to do |format|
format.html { redirect_to dashboard_todos_path, status: 302, notice: _('All todos were marked as done.') }
format.html { redirect_to dashboard_todos_path, status: 302, notice: _('Everything on your to-do list is marked as done.') }
format.js { head :ok }
format.json { render json: todos_counts.merge(updated_ids: updated_ids) }
end
......
......@@ -390,8 +390,8 @@ module IssuablesHelper
def issuable_todo_button_data(issuable, is_collapsed)
{
todo_text: _('Add todo'),
mark_text: _('Mark todo as done'),
todo_text: _('Add a To Do'),
mark_text: _('Mark as done'),
todo_icon: sprite_icon('todo-add'),
mark_icon: sprite_icon('todo-done', css_class: 'todo-undone'),
issuable_id: issuable[:id],
......
......@@ -16,7 +16,7 @@ module PreferencesHelper
project_activity: _("Your Projects' Activity"),
starred_project_activity: _("Starred Projects' Activity"),
groups: _("Your Groups"),
todos: _("Your Todos"),
todos: _("Your To-Do List"),
issues: _("Assigned Issues"),
merge_requests: _("Assigned Merge Requests"),
operations: _("Operations Dashboard")
......
......@@ -49,5 +49,5 @@
- else
.todo-actions
= link_to restore_dashboard_todo_path(todo), method: :patch, class: 'btn btn-loading js-add-todo', data: { href: restore_dashboard_todo_path(todo) } do
Add todo
Add a To Do
= icon('spinner spin')
- @hide_top_links = true
- page_title "Todos"
- header_title "Todos", dashboard_todos_path
- page_title "To-Do List"
- header_title "To-Do List", dashboard_todos_path
= render_dashboard_gold_trial(current_user)
.page-title-holder.d-flex.align-items-center
%h1.page-title= _('Todos')
%h1.page-title= _('To-Do List')
- if current_user.todos.any?
.top-area
......@@ -13,7 +13,7 @@
%li.todos-pending{ class: active_when(params[:state].blank? || params[:state] == 'pending') }>
= link_to todos_filter_path(state: 'pending') do
%span
Todos
To Do
%span.badge.badge-pill
= number_with_delimiter(todos_pending_count)
%li.todos-done{ class: active_when(params[:state] == 'done') }>
......@@ -102,24 +102,24 @@
%p
Are you looking for things to do? Take a look at
= succeed "," do
= link_to "the opened issues", issues_dashboard_path
= link_to "open issues", issues_dashboard_path
contribute to
= link_to "merge requests", merge_requests_dashboard_path
or mention someone in a comment to assign a new todo automatically.
= link_to "a merge request\,", merge_requests_dashboard_path
or mention someone in a comment to automatically assign them a new to-do item.
- else
%h4.text-center
There are no todos to show.
Nothing is on your to-do list. Nice work!
- else
.todos-empty
.todos-empty-hero.svg-content
= image_tag 'illustrations/todos_empty.svg'
.todos-empty-content
%h4
Todos let you see what you should do next
Your To-Do List shows what to work on next
%p
When an issue or merge request is assigned to you, or when you
When an issue or merge request is assigned to you, or when you receive a
%strong
@mention
in a comment, this will trigger a new item in your todo list, automatically.
in a comment, this automatically triggers a new item in your To-Do List.
%p
You will always know what to work on next.
It's how you always know what to work on next.
......@@ -53,7 +53,7 @@
= number_with_delimiter(merge_requests_count)
- if header_link?(:todos)
= nav_link(controller: 'dashboard/todos', html_options: { class: "user-counter" }) do
= link_to dashboard_todos_path, title: _('Todos'), aria: { label: _('Todos') }, class: 'shortcuts-todos', data: {toggle: 'tooltip', placement: 'bottom', container: 'body'} do
= link_to dashboard_todos_path, title: _('To-Do List'), aria: { label: _('To-Do List') }, class: 'shortcuts-todos', data: {toggle: 'tooltip', placement: 'bottom', container: 'body'} do
= sprite_icon('todo-done', size: 16)
%span.badge.badge-pill.todos-count{ class: ('hidden' if todos_pending_count.zero?) }
= todos_count_format(todos_pending_count)
......
......@@ -10,7 +10,7 @@
.block.issuable-sidebar-header
- if signed_in
%span.issuable-header-text.hide-collapsed.float-left
= _('Todo')
= _('To Do')
%a.gutter-toggle.float-right.js-sidebar-toggle.has-tooltip{ role: "button", href: "#", "aria-label" => "Toggle sidebar", title: sidebar_gutter_tooltip_text, data: { container: 'body', placement: 'left', boundary: 'viewport' } }
= sidebar_gutter_toggle_icon
- if signed_in
......
---
title: Changes "Todo" to "To Do" in the UI for clarity
merge_request: 28844
author:
type: other
......@@ -4,8 +4,8 @@
# If you come up with a fun one, please feel free to contribute it to GitLab!
# https://about.gitlab.com/contributing/
---
- Good job! Looks like you don't have any todos left
- Isn't an empty todo list beautiful?
- Good job! Looks like you don't have anything left on your To-Do List
- Isn't an empty To-Do List beautiful?
- Give yourself a pat on the back!
- Nothing left to do, high five!
- Henceforth you shall be known as "Todo Destroyer"
- Nothing left to do. High five!
- Henceforth, you shall be known as "To-Do Destroyer"
......@@ -39,11 +39,14 @@ after it is closed.
![Report Abuse](img/report-abuse.png)
#### 2. Todos
#### 2. To Do
You can click **add todo** to add the issue to your [GitLab Todo](../../../workflow/todos.md)
list. If it is already on your todo list, the buttom will show **mark todo as done**,
which you can click to mark that issue as done (which will be reflected in the Todo list).
You can add issues to and remove issues from your [GitLab To-Do List](../../../workflow/todos.md).
The button to do this has a different label depending on whether the issue is already on your To-Do List or not. If the issue is:
- Already on your To-Do List: The button is labeled **Mark as done**. Click the button to remove the issue from your To-Do List.
- Not on your To-Do List: The button is labelled **Add a To Do**. Click the button to add the issue to your To-Do List.
#### 3. Assignee
......@@ -206,6 +209,14 @@ You can filter what is displayed in the issue history by clicking on **Show all
and selecting either **Show comments only**, which only shows discussions and hides
updates to the issue, or **Show history only**, which hides discussions and only shows updates.
- You can mention a user or a group present in your GitLab instance with
`@username` or `@groupname` and they will be notified via To-Do items
and email, unless they have [disabled all notifications](#13-notifications)
in their profile settings.
- Mentions for yourself (the current logged in user), will be highlighted
in a different color, allowing you to easily see which comments involve you,
helping you focus on them quickly.
![Show all activity](img/show-all-activity.png)
#### 22. Create Merge Request
......
......@@ -16,8 +16,8 @@ discussions, and descriptions:
|:---------------------------|:------------------------------ |:------|:--------------|
| `/tableflip <Comment>` | Append the comment with `(╯°□°)╯︵ ┻━┻` | ✓ | ✓ |
| `/shrug <Comment>` | Append the comment with `¯\_(ツ)_/¯` | ✓ | ✓ |
| `/todo` | Add a todo | ✓ | ✓ |
| `/done` | Mark todo as done | ✓ | ✓ |
| `/todo` | Add a To Do | ✓ | ✓ |
| `/done` | Mark To Do as done | ✓ | ✓ |
| `/subscribe` | Subscribe | ✓ | ✓ |
| `/unsubscribe` | Unsubscribe | ✓ | ✓ |
| `/close` | Close | ✓ | ✓ |
......@@ -75,8 +75,8 @@ The following quick actions are applicable for epics threads and description:
|:---------------------------|:----------------------------------------|
| `/tableflip <Comment>` | Append the comment with `(╯°□°)╯︵ ┻━┻` |
| `/shrug <Comment>` | Append the comment with `¯\_(ツ)_/¯` |
| `/todo` | Add a todo |
| `/done` | Mark todo as done |
| `/todo` | Add a To Do |
| `/done` | Mark To Do as done |
| `/subscribe` | Subscribe |
| `/unsubscribe` | Unsubscribe |
| `/close` | Close |
......
......@@ -97,10 +97,10 @@ quickly access issues and merge requests created or assigned to you within that
![search per project - shortcut](img/project_search.png)
## Todos
## To-Do List
Your [todos](../../workflow/todos.md#gitlab-todos) can be searched by "to do" and "done".
You can [filter](../../workflow/todos.md#filtering-your-todos) them per project,
Your [To-Do List](../../workflow/todos.md#gitlab-to-do-list) can be searched by "to do" and "done".
You can [filter](../../workflow/todos.md#filtering-your-to-do-list) them per project,
author, type, and action. Also, you can sort them by
[**Label priority**](../../user/project/labels.md#label-priority),
**Last created** and **Oldest created**.
......
# GitLab Todos
# GitLab To-Do List
> [Introduced][ce-2817] in GitLab 8.5.
When you log into GitLab, you normally want to see where you should spend your
time and take some action, or what you need to keep an eye on. All without the
mess of a huge pile of e-mail notifications. GitLab is where you do your work,
so being able to get started quickly is very important.
time, take some action, or know what you need to keep an eye on without
a huge pile of e-mail notifications. GitLab is where you do your work,
so being able to get started quickly is important.
Todos is a chronological list of to-dos that are waiting for your input, all
Your To-Do List offers a chronological list of items that are waiting for your input, all
in a simple dashboard.
![Todos screenshot showing a list of items to check on](img/todos_index.png)
![To Do screenshot showing a list of items to check on](img/todos_index.png)
---
You can quickly access the Todos dashboard using the checkmark icon next to the
search bar in the upper right corner. The number in blue is the number of Todos
you still have open if the count is < 100, else it's 99+. The exact number
will still be shown in the body of the _To do_ tab.
You can quickly access your To-Do List by clicking the checkmark icon next to the
search bar in the top navigation. If the count is:
![Todos icon](img/todos_icon.png)
- Less than 100, the number in blue is the number of To-Do items.
- 100 or more, the number displays as 99+. The exact number displays
on the To-Do List.
you still have open. Otherwise, the number displays as 99+. The exact number
displays on the To-Do List.
## What triggers a Todo
![To Do icon](img/todos_icon.png)
A Todo appears in your Todos dashboard when:
## What triggers a To Do
- an issue or merge request is assigned to you
- you are `@mentioned` in the description or in a comment of an issue, merge request, or epic **[ULTIMATE]**
- you are `@mentioned` in a comment on a commit,
- a job in the CI pipeline running for your merge request failed, but this
job is not allowed to fail.
- an open merge request becomes unmergeable due to conflict, and you are either:
- the author, or
- have set it to automatically merge once pipeline succeeds.
A To Do displays on your To-Do List when:
Todo triggers are not affected by [GitLab Notification Email settings](notifications.md).
- An issue or merge request is assigned to you
- You are `@mentioned` in the description or comment of an:
- Issue
- Merge Request
- Epic **[ULTIMATE]**
- You are `@mentioned` in a comment on a commit
- A job in the CI pipeline running for your merge request failed, but this
job is not allowed to fail
- An open merge request becomes unmergeable due to conflict, and you are either:
- The author
- Have set it to automatically merge once the pipeline succeeds
To-do triggers are not affected by [GitLab Notification Email settings](notifications.md).
NOTE: **Note:**
When an user no longer has access to a resource related to a Todo like an issue, merge request, project or group the related Todos, for security reasons, gets deleted within the next hour. The delete is delayed to prevent data loss in case user got their access revoked by mistake.
When a user no longer has access to a resource related to a To Do (like an issue, merge request, project, or group) the related To-Do items are deleted within the next hour for security reasons. The delete is delayed to prevent data loss, in case the user's access was revoked by mistake.
### Directly addressed Todos
### Directly addressing a To Do
> [Introduced][ce-7926] in GitLab 9.0.
If you are mentioned at the start of a line, the todo you receive will be listed
as 'directly addressed'. For instance, in this comment:
If you are mentioned at the start of a line, the To Do you receive will be listed
as 'directly addressed'. For example, in this comment:
```markdown
@alice What do you think? cc: @bob
......@@ -58,67 +65,80 @@ as 'directly addressed'. For instance, in this comment:
@erin @frank thank you!
```
The people receiving directly addressed todos are `@alice`, `@erin`, and
`@frank`. Directly addressed todos only differ from mention todos in their type,
for filtering; otherwise, they appear as normal.
The people receiving directly addressed To-Do items are `@alice`, `@erin`, and
`@frank`. Directly addressed To-Do items only differ from mentions in their type
for filtering purposes; otherwise, they appear as normal.
### Manually creating a To Do
You can also add the following to your To-Do List by clicking the **Add a To Do** button on an:
### Manually creating a Todo
- Issue
- Merge Request
- Epic **[ULTIMATE]**
You can also add an issue, merge request or epic to your Todos dashboard by clicking
the "Add todo" button in the sidebar of the issue, merge request, or epic **[ULTIMATE]**.
![Adding a To Do from the issuable sidebar](img/todos_add_todo_sidebar.png)
![Adding a Todo from the issuable sidebar](img/todos_add_todo_sidebar.png)
## Marking a To Do as done
## Marking a Todo as done
Any action to the following will mark the corresponding To Do as done:
Any action to the corresponding issue, merge request or epic **[ULTIMATE]** will mark your Todo as
**Done**. Actions that dismiss Todos include:
- Issue
- Merge Request
- Epic **[ULTIMATE]**
- changing the assignee
- changing the milestone
- adding/removing a label
- commenting on the issue
Actions that dismiss To-Do items include:
- Changing the assignee
- Changing the milestone
- Adding/removing a label
- Commenting on the issue
---
Todos are personal, and they're only marked as done if the action is coming from
you. If you close the issue or merge request, your Todo will automatically
be marked as done.
Your To-Do List is personal, and items are only marked as done if the action comes from
you. If you close the issue or merge request, your To Do is automatically
marked as done.
To prevent other users from closing issues without you being notified, if someone else closes, merges, or takes action on the any of the following, your To Do will remain pending:
If someone else closes, merges, or takes action on the issue, epic or merge
request, your Todo will remain pending. This prevents other users from closing issues without you being notified.
- Issue
- Merge request
- Epic **[ULTIMATE]**
There is just one Todo per issue, epic or merge request, so mentioning a user a
hundred times in an issue will only trigger one Todo.
There is just one To Do for each of these, so mentioning a user a hundred times in an issue will only trigger one To Do.
---
If no action is needed, you can manually mark the Todo as done by clicking the
corresponding **Done** button, and it will disappear from your Todo list.
If no action is needed, you can manually mark the To Do as done by clicking the
corresponding **Done** button, and it will disappear from your To-Do List.
![A To Do in the To-Do List](img/todo_list_item.png)
![A Todo in the Todos dashboard](img/todo_list_item.png)
You can also mark a To Do as done by clicking the **Mark as done** button in the sidebar of the following:
A Todo can also be marked as done from the issue, merge request or epic sidebar using
the "Mark todo as done" button.
- Issue
- Merge Request
- Epic **[ULTIMATE]**
![Mark todo as done from the issuable sidebar](img/todos_mark_done_sidebar.png)
![Mark as done from the issuable sidebar](img/todos_mark_done_sidebar.png)
You can mark all your Todos as done at once by clicking on the **Mark all as
You can mark all your To-Do items as done at once by clicking the **Mark all as
done** button.
## Filtering your Todos
## Filtering your To-Do List
There are four kinds of filters you can use on your Todos dashboard.
There are four kinds of filters you can use on your To-Do List.
| Filter | Description |
| ------- | ----------- |
| Project | Filter by project |
| Group | Filter by group |
| Author | Filter by the author that triggered the Todo |
| Author | Filter by the author that triggered the To Do |
| Type | Filter by issue, merge request, or epic **[ULTIMATE]** |
| Action | Filter by the action that triggered the Todo |
| Action | Filter by the action that triggered the To Do |
You can also filter by more than one of these at the same time. The possible Actions are `Any Action`, `Assigned`, `Mentioned`, `Added`, `Pipelines`, and `Directly Addressed`, [as described above](#what-triggers-a-todo).
You can also filter by more than one of these at the same time. The possible Actions are `Any Action`, `Assigned`, `Mentioned`, `Added`, `Pipelines`, and `Directly Addressed`, [as described above](#what-triggers-a-to-do).
[ce-2817]: https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/2817
[ce-7926]: https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/7926
......@@ -146,8 +146,8 @@ module Gitlab
@updates[:todo_event] = 'add'
end
desc _('Mark todo as done')
explanation _('Marks todo as done.')
desc _('Mark to do as done')
explanation _('Marks to do as done.')
types Issuable
condition do
quick_action_target.persisted? &&
......
......@@ -626,6 +626,9 @@ msgstr ""
msgid "Add a Grafana button in the admin sidebar, monitoring section, to access a variety of statistics on the health and performance of GitLab."
msgstr ""
msgid "Add a To Do"
msgstr ""
msgid "Add a bullet list"
msgstr ""
......@@ -704,9 +707,6 @@ msgstr ""
msgid "Add to review"
msgstr ""
msgid "Add todo"
msgstr ""
msgid "Add user(s) to the group:"
msgstr ""
......@@ -893,9 +893,6 @@ msgstr ""
msgid "All projects"
msgstr ""
msgid "All todos were marked as done."
msgstr ""
msgid "All users"
msgstr ""
......@@ -4288,10 +4285,10 @@ msgstr ""
msgid "Error updating %{issuableType}"
msgstr ""
msgid "Error updating status for all todos."
msgid "Error updating status for all to-do items."
msgstr ""
msgid "Error updating todo status."
msgid "Error updating status of to-do item."
msgstr ""
msgid "Error uploading file"
......@@ -4390,6 +4387,9 @@ msgstr ""
msgid "Everyone can contribute"
msgstr ""
msgid "Everything on your to-do list is marked as done."
msgstr ""
msgid "Everything you need to create a GitLab Pages site using GitBook."
msgstr ""
......@@ -6249,6 +6249,9 @@ msgstr ""
msgid "March"
msgstr ""
msgid "Mark as done"
msgstr ""
msgid "Mark as resolved"
msgstr ""
......@@ -6258,7 +6261,7 @@ msgstr ""
msgid "Mark this issue as a duplicate of another issue"
msgstr ""
msgid "Mark todo as done"
msgid "Mark to do as done"
msgstr ""
msgid "Markdown"
......@@ -6273,7 +6276,7 @@ msgstr ""
msgid "Marks this issue as a duplicate of %{duplicate_reference}."
msgstr ""
msgid "Marks todo as done."
msgid "Marks to do as done."
msgstr ""
msgid "Max access level"
......@@ -11173,16 +11176,13 @@ msgstr ""
msgid "To widen your search, change or remove filters above"
msgstr ""
msgid "Today"
msgid "To-Do List"
msgstr ""
msgid "Todo"
msgid "To-do item successfully marked as done."
msgstr ""
msgid "Todo was successfully marked as done."
msgstr ""
msgid "Todos"
msgid "Today"
msgstr ""
msgid "Toggle Sidebar"
......@@ -12429,7 +12429,7 @@ msgstr ""
msgid "Your SSH keys (%{count})"
msgstr ""
msgid "Your Todos"
msgid "Your To-Do List"
msgstr ""
msgid "Your U2F device did not send a valid JSON response."
......
......@@ -22,7 +22,7 @@ describe 'Dashboard shortcuts', :js do
find('body').send_keys([:shift, 'T'])
check_page_title('Todos')
check_page_title('To-Do List')
find('body').send_keys([:shift, 'P'])
......
......@@ -13,7 +13,7 @@ describe 'Dashboard Todos' do
end
it 'shows "All done" message' do
expect(page).to have_content 'Todos let you see what you should do next'
expect(page).to have_content 'Your To-Do List shows what to work on next'
end
end
......@@ -72,7 +72,7 @@ describe 'Dashboard Todos' do
end
it 'updates todo count' do
expect(page).to have_content 'Todos 0'
expect(page).to have_content 'To Do 0'
expect(page).to have_content 'Done 1'
end
......@@ -101,7 +101,7 @@ describe 'Dashboard Todos' do
end
it 'updates todo count' do
expect(page).to have_content 'Todos 1'
expect(page).to have_content 'To Do 1'
expect(page).to have_content 'Done 0'
end
end
......@@ -211,7 +211,7 @@ describe 'Dashboard Todos' do
describe 'restoring the todo' do
before do
within first('.todo') do
click_link 'Add todo'
click_link 'Add a To Do'
end
end
......@@ -220,7 +220,7 @@ describe 'Dashboard Todos' do
end
it 'updates todo count' do
expect(page).to have_content 'Todos 1'
expect(page).to have_content 'To Do 1'
expect(page).to have_content 'Done 0'
end
end
......@@ -276,7 +276,7 @@ describe 'Dashboard Todos' do
end
it 'shows "All done" message!' do
expect(page).to have_content 'Todos 0'
expect(page).to have_content 'To Do 0'
expect(page).to have_content "You're all done!"
expect(page).not_to have_selector('.gl-pagination')
end
......@@ -303,7 +303,7 @@ describe 'Dashboard Todos' do
it 'updates todo count' do
mark_all_and_undo
expect(page).to have_content 'Todos 2'
expect(page).to have_content 'To Do 2'
expect(page).to have_content 'Done 0'
end
......
......@@ -13,8 +13,8 @@ describe 'Manually create a todo item from issue', :js do
it 'creates todo when clicking button' do
page.within '.issuable-sidebar' do
click_button 'Add todo'
expect(page).to have_content 'Mark todo as done'
click_button 'Add a To Do'
expect(page).to have_content 'Mark as done'
end
page.within '.header-content .todos-count' do
......@@ -30,8 +30,8 @@ describe 'Manually create a todo item from issue', :js do
it 'marks a todo as done' do
page.within '.issuable-sidebar' do
click_button 'Add todo'
click_button 'Mark todo as done'
click_button 'Add a To Do'
click_button 'Mark as done'
end
expect(page).to have_selector('.todos-count', visible: false)
......
......@@ -28,7 +28,7 @@ describe PreferencesHelper do
["Your Projects' Activity", 'project_activity'],
["Starred Projects' Activity", 'starred_project_activity'],
["Your Groups", 'groups'],
["Your Todos", 'todos'],
["Your To-Do List", 'todos'],
["Assigned Issues", 'issues'],
["Assigned Merge Requests", 'merge_requests']
]
......
......@@ -58,7 +58,7 @@ describe('Issuable right sidebar collapsed todo toggle', () => {
it('sets default tooltip title', () => {
expect(
document.querySelector('.js-issuable-todo.sidebar-collapsed-icon').getAttribute('title'),
).toBe('Add todo');
).toBe('Add a To Do');
});
it('toggle todo state', done => {
......@@ -85,7 +85,7 @@ describe('Issuable right sidebar collapsed todo toggle', () => {
setTimeout(() => {
expect(
document.querySelector('.issuable-sidebar-header .js-issuable-todo').textContent.trim(),
).toBe('Mark todo as done');
).toBe('Mark as done');
done();
});
......@@ -99,7 +99,7 @@ describe('Issuable right sidebar collapsed todo toggle', () => {
document
.querySelector('.js-issuable-todo.sidebar-collapsed-icon')
.getAttribute('data-original-title'),
).toBe('Mark todo as done');
).toBe('Mark as done');
done();
});
......@@ -124,13 +124,13 @@ describe('Issuable right sidebar collapsed todo toggle', () => {
expect(
document.querySelector('.issuable-sidebar-header .js-issuable-todo').textContent.trim(),
).toBe('Add todo');
).toBe('Add a To Do');
})
.then(done)
.catch(done.fail);
});
it('updates aria-label to mark todo as done', done => {
it('updates aria-label to Mark as done', done => {
document.querySelector('.js-issuable-todo.sidebar-collapsed-icon').click();
setTimeout(() => {
......@@ -138,7 +138,7 @@ describe('Issuable right sidebar collapsed todo toggle', () => {
document
.querySelector('.js-issuable-todo.sidebar-collapsed-icon')
.getAttribute('aria-label'),
).toBe('Mark todo as done');
).toBe('Mark as done');
done();
});
......@@ -153,7 +153,7 @@ describe('Issuable right sidebar collapsed todo toggle', () => {
document
.querySelector('.js-issuable-todo.sidebar-collapsed-icon')
.getAttribute('aria-label'),
).toBe('Mark todo as done');
).toBe('Mark as done');
document.querySelector('.js-issuable-todo.sidebar-collapsed-icon').click();
})
......@@ -163,7 +163,7 @@ describe('Issuable right sidebar collapsed todo toggle', () => {
document
.querySelector('.js-issuable-todo.sidebar-collapsed-icon')
.getAttribute('aria-label'),
).toBe('Add todo');
).toBe('Add a To Do');
})
.then(done)
.catch(done.fail);
......
......@@ -53,14 +53,14 @@ describe('SidebarTodo', () => {
describe('buttonLabel', () => {
it('returns todo button text for marking todo as done when `isTodo` prop is `true`', () => {
expect(vm.buttonLabel).toBe('Mark todo as done');
expect(vm.buttonLabel).toBe('Mark as done');
});
it('returns todo button text for add todo when `isTodo` prop is `false`', done => {
vm.isTodo = false;
Vue.nextTick()
.then(() => {
expect(vm.buttonLabel).toBe('Add todo');
expect(vm.buttonLabel).toBe('Add a To Do');
})
.then(done)
.catch(done.fail);
......@@ -131,14 +131,14 @@ describe('SidebarTodo', () => {
});
it('check button label computed property', () => {
expect(vm.buttonLabel).toEqual('Mark todo as done');
expect(vm.buttonLabel).toEqual('Mark as done');
});
it('renders button label element when `collapsed` prop is `false`', () => {
const buttonLabelEl = vm.$el.querySelector('span.issuable-todo-inner');
expect(buttonLabelEl).not.toBeNull();
expect(buttonLabelEl.innerText.trim()).toBe('Mark todo as done');
expect(buttonLabelEl.innerText.trim()).toBe('Mark as done');
});
it('renders button icon when `collapsed` prop is `true`', 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