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
path: root/spec
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2019-09-25 18:06:16 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2019-09-25 18:06:16 +0300
commitb1d7b01241da7f7f5d42c5ef46c7788fac0ab6d3 (patch)
treeb53def1340801c2b7706e9f68f6b17a36efad4dd /spec
parentaabf412bc1f30cb12d97a077458d002c57cad8e9 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec')
-rw-r--r--spec/fixtures/api/schemas/list.json3
-rw-r--r--spec/fixtures/api/schemas/public_api/v4/board.json3
-rw-r--r--spec/frontend/issue_show/store_spec.js39
-rw-r--r--spec/frontend/issue_show/utils/update_description_spec.js24
-rw-r--r--spec/javascripts/issue_show/components/app_spec.js8
-rw-r--r--spec/javascripts/monitoring/charts/time_series_spec.js10
-rw-r--r--spec/lib/gitlab/import_export/safe_model_attributes.yml1
-rw-r--r--spec/support/shared_examples/slack_mattermost_notifications_shared_examples.rb2
8 files changed, 86 insertions, 4 deletions
diff --git a/spec/fixtures/api/schemas/list.json b/spec/fixtures/api/schemas/list.json
index b76ec115293..7603892e198 100644
--- a/spec/fixtures/api/schemas/list.json
+++ b/spec/fixtures/api/schemas/list.json
@@ -35,7 +35,8 @@
}
},
"title": { "type": "string" },
- "position": { "type": ["integer", "null"] }
+ "position": { "type": ["integer", "null"] },
+ "max_issue_count": { "type": "integer" }
},
"additionalProperties": true
}
diff --git a/spec/fixtures/api/schemas/public_api/v4/board.json b/spec/fixtures/api/schemas/public_api/v4/board.json
index d667f1d631c..8dc3999baa2 100644
--- a/spec/fixtures/api/schemas/public_api/v4/board.json
+++ b/spec/fixtures/api/schemas/public_api/v4/board.json
@@ -76,7 +76,8 @@
"name": { "type": "string" }
}
},
- "position": { "type": ["integer", "null"] }
+ "position": { "type": ["integer", "null"] },
+ "max_issue_count": { "type": "integer" }
},
"additionalProperties": false
}
diff --git a/spec/frontend/issue_show/store_spec.js b/spec/frontend/issue_show/store_spec.js
new file mode 100644
index 00000000000..b7fd70bf00e
--- /dev/null
+++ b/spec/frontend/issue_show/store_spec.js
@@ -0,0 +1,39 @@
+import Store from '~/issue_show/stores';
+import updateDescription from '~/issue_show/utils/update_description';
+
+jest.mock('~/issue_show/utils/update_description');
+
+describe('Store', () => {
+ let store;
+
+ beforeEach(() => {
+ store = new Store({
+ descriptionHtml: '<p>This is a description</p>',
+ });
+ });
+
+ describe('updateState', () => {
+ beforeEach(() => {
+ document.body.innerHTML = `
+ <div class="detail-page-description content-block">
+ <details open>
+ <summary>One</summary>
+ </details>
+ <details>
+ <summary>Two</summary>
+ </details>
+ </div>
+ `;
+ });
+
+ afterEach(() => {
+ document.getElementsByTagName('html')[0].innerHTML = '';
+ });
+
+ it('calls updateDetailsState', () => {
+ store.updateState({ description: '' });
+
+ expect(updateDescription).toHaveBeenCalledTimes(1);
+ });
+ });
+});
diff --git a/spec/frontend/issue_show/utils/update_description_spec.js b/spec/frontend/issue_show/utils/update_description_spec.js
new file mode 100644
index 00000000000..b2c6bd3c302
--- /dev/null
+++ b/spec/frontend/issue_show/utils/update_description_spec.js
@@ -0,0 +1,24 @@
+import updateDescription from '~/issue_show/utils/update_description';
+
+describe('updateDescription', () => {
+ it('returns the correct value to be set as descriptionHtml', () => {
+ const actual = updateDescription(
+ '<details><summary>One</summary></details><details><summary>Two</summary></details>',
+ [{ open: true }, { open: false }], // mocking NodeList from the dom.
+ );
+
+ expect(actual).toEqual(
+ '<details open="true"><summary>One</summary></details><details><summary>Two</summary></details>',
+ );
+ });
+
+ describe('when description details returned from api is different then whats currently on the dom', () => {
+ it('returns the description from the api', () => {
+ const dataDescription = '<details><summary>One</summary></details>';
+
+ const actual = updateDescription(dataDescription, []);
+
+ expect(actual).toEqual(dataDescription);
+ });
+ });
+});
diff --git a/spec/javascripts/issue_show/components/app_spec.js b/spec/javascripts/issue_show/components/app_spec.js
index c3d1440c34e..9fce040fd8c 100644
--- a/spec/javascripts/issue_show/components/app_spec.js
+++ b/spec/javascripts/issue_show/components/app_spec.js
@@ -23,6 +23,14 @@ describe('Issuable output', () => {
beforeEach(done => {
setFixtures(`
<div>
+ <div class="detail-page-description content-block">
+ <details open>
+ <summary>One</summary>
+ </details>
+ <details>
+ <summary>Two</summary>
+ </details>
+ </div>
<div class="flash-container"></div>
<span id="task_status"></span>
</div>
diff --git a/spec/javascripts/monitoring/charts/time_series_spec.js b/spec/javascripts/monitoring/charts/time_series_spec.js
index f6a5ed03c0d..091ab06523e 100644
--- a/spec/javascripts/monitoring/charts/time_series_spec.js
+++ b/spec/javascripts/monitoring/charts/time_series_spec.js
@@ -140,6 +140,16 @@ describe('Time series component', () => {
expect(timeSeriesChart.vm.svgs[mockSvgName]).toBe(`path://${mockSvgPathContent}`);
});
});
+
+ it('contains an svg object within an array to properly render icon', () => {
+ timeSeriesChart.vm.$nextTick(() => {
+ expect(timeSeriesChart.vm.chartOptions.dataZoom).toEqual([
+ {
+ handleIcon: `path://${mockSvgPathContent}`,
+ },
+ ]);
+ });
+ });
});
describe('onResize', () => {
diff --git a/spec/lib/gitlab/import_export/safe_model_attributes.yml b/spec/lib/gitlab/import_export/safe_model_attributes.yml
index 2f178648838..f87b0cdd3c6 100644
--- a/spec/lib/gitlab/import_export/safe_model_attributes.yml
+++ b/spec/lib/gitlab/import_export/safe_model_attributes.yml
@@ -717,6 +717,7 @@ List:
- updated_at
- milestone_id
- user_id
+- max_issue_count
ExternalPullRequest:
- id
- created_at
diff --git a/spec/support/shared_examples/slack_mattermost_notifications_shared_examples.rb b/spec/support/shared_examples/slack_mattermost_notifications_shared_examples.rb
index 455f7b117b2..1ead9ec2738 100644
--- a/spec/support/shared_examples/slack_mattermost_notifications_shared_examples.rb
+++ b/spec/support/shared_examples/slack_mattermost_notifications_shared_examples.rb
@@ -1,7 +1,5 @@
# frozen_string_literal: true
-Dir[Rails.root.join("app/models/project_services/chat_message/*.rb")].each { |f| require f }
-
RSpec.shared_examples 'slack or mattermost notifications' do |service_name|
let(:chat_service) { described_class.new }
let(:webhook_url) { 'https://example.gitlab.com/' }