Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'spec/frontend/sidebar/components/todo_toggle/sidebar_todo_widget_spec.js')
-rw-r--r--spec/frontend/sidebar/components/todo_toggle/sidebar_todo_widget_spec.js21
1 files changed, 21 insertions, 0 deletions
diff --git a/spec/frontend/sidebar/components/todo_toggle/sidebar_todo_widget_spec.js b/spec/frontend/sidebar/components/todo_toggle/sidebar_todo_widget_spec.js
index 39b480b295c..b2477e9b41c 100644
--- a/spec/frontend/sidebar/components/todo_toggle/sidebar_todo_widget_spec.js
+++ b/spec/frontend/sidebar/components/todo_toggle/sidebar_todo_widget_spec.js
@@ -22,6 +22,7 @@ describe('Sidebar Todo Widget', () => {
const createComponent = ({
todosQueryHandler = jest.fn().mockResolvedValue(noTodosResponse),
+ provide = {},
} = {}) => {
fakeApollo = createMockApollo([[epicTodoQuery, todosQueryHandler]]);
@@ -30,6 +31,7 @@ describe('Sidebar Todo Widget', () => {
provide: {
canUpdate: true,
isClassicSidebar: true,
+ ...provide,
},
propsData: {
fullPath: 'group',
@@ -122,4 +124,23 @@ describe('Sidebar Todo Widget', () => {
expect(wrapper.emitted('todoUpdated')).toEqual([[false]]);
});
});
+
+ describe('when the query is pending', () => {
+ it('is in the loading state', () => {
+ createComponent();
+
+ expect(findTodoButton().attributes('loading')).toBe('true');
+ });
+
+ it('is not in the loading state if notificationsTodosButtons and movedMrSidebar feature flags are enabled', () => {
+ createComponent({
+ provide: {
+ glFeatures: { notificationsTodosButtons: true, movedMrSidebar: true },
+ },
+ });
+
+ expect(findTodoButton().attributes('loading')).toBeUndefined();
+ expect(findTodoButton().attributes('disabled')).toBe('true');
+ });
+ });
});