diff options
Diffstat (limited to 'spec')
-rw-r--r-- | spec/frontend/boards/components/board_content_layout_spec.js | 66 | ||||
-rw-r--r-- | spec/frontend/boards/components/board_content_spec.js | 40 | ||||
-rw-r--r-- | spec/lib/gitlab/alerting/alert_spec.rb | 4 | ||||
-rw-r--r-- | spec/lib/gitlab/utils/usage_data_spec.rb | 2 | ||||
-rw-r--r-- | spec/requests/api/issues/issues_spec.rb | 6 |
5 files changed, 9 insertions, 109 deletions
diff --git a/spec/frontend/boards/components/board_content_layout_spec.js b/spec/frontend/boards/components/board_content_layout_spec.js deleted file mode 100644 index b6e260de8dd..00000000000 --- a/spec/frontend/boards/components/board_content_layout_spec.js +++ /dev/null @@ -1,66 +0,0 @@ -import { mount } from '@vue/test-utils'; -import BoardContentLayout from '~/boards/components/board_content_layout.vue'; - -const TestComponent = { - components: { BoardContentLayout }, - template: ` - <div> - <board-content-layout v-bind="$attrs"> - <template v-slot:board-content-decoration="{ groupId }"> - <p data-testid="child">{{ groupId }}</p> - </template> - </board-content-layout> - </div> - `, -}; - -describe('BoardContentLayout', () => { - let wrapper; - const groupId = 1; - - const createComponent = props => { - wrapper = mount(TestComponent, { - propsData: { - lists: [], - canAdminList: true, - groupId, - disabled: false, - issueLinkBase: '', - rootPath: '', - boardId: '', - ...props, - }, - }); - }; - - afterEach(() => { - wrapper.destroy(); - wrapper = null; - }); - - it('renders children in the slot', () => { - createComponent(); - - expect(wrapper.find('[data-testid="child"]').exists()).toBe(true); - }); - - it('renders groupId from the scoped slot', () => { - createComponent(); - - expect(wrapper.find('[data-testid="child"]').text()).toContain(groupId); - }); - - describe('when isSwimlanesOff', () => { - it('renders the correct class on the root div', () => { - createComponent({ isSwimlanesOff: true }); - - expect(wrapper.find('[data-testid="boards_list"]').classes()).toEqual([ - 'boards-list', - 'gl-w-full', - 'gl-py-5', - 'gl-px-3', - 'gl-white-space-nowrap', - ]); - }); - }); -}); diff --git a/spec/frontend/boards/components/board_content_spec.js b/spec/frontend/boards/components/board_content_spec.js deleted file mode 100644 index 5f8d34aa519..00000000000 --- a/spec/frontend/boards/components/board_content_spec.js +++ /dev/null @@ -1,40 +0,0 @@ -import { mount } from '@vue/test-utils'; -import axios from 'axios'; -import MockAdapter from 'axios-mock-adapter'; -import BoardContent from '~/boards/components/board_content.vue'; -import BoardColumn from '~/boards/components/board_column.vue'; -import List from '~/boards/models/list'; -import { listObj } from '../mock_data'; - -describe('BoardContent', () => { - let wrapper; - let mock; - - const createComponent = () => { - wrapper = mount(BoardContent, { - propsData: { - lists: [new List(listObj)], - canAdminList: true, - groupId: 1, - disabled: false, - issueLinkBase: '', - rootPath: '', - boardId: '', - }, - }); - }; - - beforeEach(() => { - mock = new MockAdapter(axios); - }); - - afterEach(() => { - mock.restore(); - }); - - it('finds BoardColumns', () => { - createComponent(); - - expect(wrapper.findAll(BoardColumn).length).toBe(1); - }); -}); diff --git a/spec/lib/gitlab/alerting/alert_spec.rb b/spec/lib/gitlab/alerting/alert_spec.rb index 9663e6af0d2..b53b71e3f3e 100644 --- a/spec/lib/gitlab/alerting/alert_spec.rb +++ b/spec/lib/gitlab/alerting/alert_spec.rb @@ -191,7 +191,7 @@ RSpec.describe Gitlab::Alerting::Alert do end context 'with payload' do - let(:time) { Time.now.change(usec: 0) } + let(:time) { Time.current.change(usec: 0) } before do payload['startsAt'] = time.rfc3339 @@ -274,7 +274,7 @@ RSpec.describe Gitlab::Alerting::Alert do before do payload.update( 'annotations' => { 'title' => 'some title' }, - 'startsAt' => Time.now.rfc3339 + 'startsAt' => Time.current.rfc3339 ) end diff --git a/spec/lib/gitlab/utils/usage_data_spec.rb b/spec/lib/gitlab/utils/usage_data_spec.rb index 7940c9af6ff..4675cbd7fa1 100644 --- a/spec/lib/gitlab/utils/usage_data_spec.rb +++ b/spec/lib/gitlab/utils/usage_data_spec.rb @@ -122,7 +122,7 @@ RSpec.describe Gitlab::Utils::UsageData do freeze_time do result = described_class.with_finished_at(:current_time) { { a: 1 } } - expect(result).to eq(a: 1, current_time: Time.now) + expect(result).to eq(a: 1, current_time: Time.current) end end end diff --git a/spec/requests/api/issues/issues_spec.rb b/spec/requests/api/issues/issues_spec.rb index 5cd8a0ea203..b638a65d65e 100644 --- a/spec/requests/api/issues/issues_spec.rb +++ b/spec/requests/api/issues/issues_spec.rb @@ -404,6 +404,12 @@ RSpec.describe API::Issues do travel_back end + it 'returns them all when argument is empty' do + get api('/issues?due_date=', user) + + expect_paginated_array_response(issue5.id, issue4.id, issue3.id, issue2.id, issue.id, closed_issue.id) + end + it 'returns issues without due date' do get api('/issues?due_date=0', user) |