summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-01-21 12:08:31 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2020-01-21 12:08:31 +0000
commit28ce39a3e0e7b47e53939a15fb823af9c433327a (patch)
treef703cd7b431827880ccb74b98d16fab0f60dd245 /spec
parentafe057a8ff8546f0032e439a9a200307fb6de86a (diff)
downloadgitlab-ce-28ce39a3e0e7b47e53939a15fb823af9c433327a.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec')
-rw-r--r--spec/features/projects/environments/environment_metrics_spec.rb4
-rw-r--r--spec/features/projects/files/edit_file_soft_wrap_spec.rb2
-rw-r--r--spec/frontend/ide/stores/actions/file_spec.js4
-rw-r--r--spec/frontend/ide/stores/modules/pipelines/actions_spec.js6
-rw-r--r--spec/frontend/import_projects/components/import_projects_table_spec.js2
-rw-r--r--spec/frontend/monitoring/components/dashboard_spec.js24
-rw-r--r--spec/frontend/notes/components/comment_form_spec.js2
-rw-r--r--spec/javascripts/blob/notebook/index_spec.js4
-rw-r--r--spec/javascripts/blob/pdf/index_spec.js2
-rw-r--r--spec/javascripts/ide/stores/actions/merge_request_spec.js6
-rw-r--r--spec/javascripts/ide/stores/actions/tree_spec.js2
-rw-r--r--spec/support/shared_examples/features/discussion_comments_shared_example.rb16
12 files changed, 35 insertions, 39 deletions
diff --git a/spec/features/projects/environments/environment_metrics_spec.rb b/spec/features/projects/environments/environment_metrics_spec.rb
index d34db5e15cc..150df66bdd7 100644
--- a/spec/features/projects/environments/environment_metrics_spec.rb
+++ b/spec/features/projects/environments/environment_metrics_spec.rb
@@ -30,9 +30,9 @@ describe 'Environment > Metrics' do
click_link('See metrics')
expect(page).to have_metrics_path(environment)
- expect(page).to have_css('div.js-environments-dropdown')
+ expect(page).to have_css('[data-qa-selector="environments_dropdown"]')
- within('div.js-environments-dropdown') do
+ within('[data-qa-selector="environments_dropdown"]') do
# Click on the dropdown
click_on(environment.name)
diff --git a/spec/features/projects/files/edit_file_soft_wrap_spec.rb b/spec/features/projects/files/edit_file_soft_wrap_spec.rb
index df6bc6883a9..53b1a522a8e 100644
--- a/spec/features/projects/files/edit_file_soft_wrap_spec.rb
+++ b/spec/features/projects/files/edit_file_soft_wrap_spec.rb
@@ -2,7 +2,7 @@
require 'spec_helper'
-describe 'Projects > Files > User uses soft wrap whilst editing file', :js do
+describe 'Projects > Files > User uses soft wrap while editing file', :js do
before do
project = create(:project, :repository)
user = project.owner
diff --git a/spec/frontend/ide/stores/actions/file_spec.js b/spec/frontend/ide/stores/actions/file_spec.js
index a8e48f0b85e..a180dd5edc1 100644
--- a/spec/frontend/ide/stores/actions/file_spec.js
+++ b/spec/frontend/ide/stores/actions/file_spec.js
@@ -389,7 +389,7 @@ describe('IDE store file actions', () => {
)
.then(() => {
expect(dispatch).toHaveBeenCalledWith('setErrorMessage', {
- text: 'An error occurred whilst loading the file.',
+ text: 'An error occurred while loading the file.',
action: expect.any(Function),
actionText: 'Please try again',
actionPayload: {
@@ -500,7 +500,7 @@ describe('IDE store file actions', () => {
)
.catch(() => {
expect(dispatch).toHaveBeenCalledWith('setErrorMessage', {
- text: 'An error occurred whilst loading the file content.',
+ text: 'An error occurred while loading the file content.',
action: expect.any(Function),
actionText: 'Please try again',
actionPayload: {
diff --git a/spec/frontend/ide/stores/modules/pipelines/actions_spec.js b/spec/frontend/ide/stores/modules/pipelines/actions_spec.js
index b08d1cd01da..71918e7e2c2 100644
--- a/spec/frontend/ide/stores/modules/pipelines/actions_spec.js
+++ b/spec/frontend/ide/stores/modules/pipelines/actions_spec.js
@@ -78,7 +78,7 @@ describe('IDE pipelines actions', () => {
{
type: 'setErrorMessage',
payload: {
- text: 'An error occurred whilst fetching the latest pipeline.',
+ text: 'An error occurred while fetching the latest pipeline.',
action: expect.any(Function),
actionText: 'Please try again',
actionPayload: null,
@@ -207,7 +207,7 @@ describe('IDE pipelines actions', () => {
{
type: 'setErrorMessage',
payload: {
- text: 'An error occurred whilst loading the pipelines jobs.',
+ text: 'An error occurred while loading the pipelines jobs.',
action: expect.anything(),
actionText: 'Please try again',
actionPayload: { id: 1 },
@@ -341,7 +341,7 @@ describe('IDE pipelines actions', () => {
{
type: 'setErrorMessage',
payload: {
- text: 'An error occurred whilst fetching the job trace.',
+ text: 'An error occurred while fetching the job trace.',
action: expect.any(Function),
actionText: 'Please try again',
actionPayload: null,
diff --git a/spec/frontend/import_projects/components/import_projects_table_spec.js b/spec/frontend/import_projects/components/import_projects_table_spec.js
index deffe22ea77..8f60823ee72 100644
--- a/spec/frontend/import_projects/components/import_projects_table_spec.js
+++ b/spec/frontend/import_projects/components/import_projects_table_spec.js
@@ -58,7 +58,7 @@ describe('ImportProjectsTable', () => {
vm.$destroy();
});
- it('renders a loading icon whilst repos are loading', () =>
+ it('renders a loading icon while repos are loading', () =>
vm.$nextTick().then(() => {
expect(vm.$el.querySelector('.js-loading-button-icon')).not.toBeNull();
}));
diff --git a/spec/frontend/monitoring/components/dashboard_spec.js b/spec/frontend/monitoring/components/dashboard_spec.js
index d1fcf1800ad..007429a3d02 100644
--- a/spec/frontend/monitoring/components/dashboard_spec.js
+++ b/spec/frontend/monitoring/components/dashboard_spec.js
@@ -52,6 +52,9 @@ describe('Dashboard', () => {
});
};
+ const findEnvironmentsDropdown = () => wrapper.find({ ref: 'monitorEnvironmentsDropdown' });
+ const findAllEnvironmentsDropdownItems = () => findEnvironmentsDropdown().findAll(GlDropdownItem);
+
beforeEach(() => {
store = createStore();
mock = new MockAdapter(axios);
@@ -71,7 +74,7 @@ describe('Dashboard', () => {
});
it('shows the environment selector', () => {
- expect(wrapper.vm.$el.querySelector('.js-environments-dropdown')).toBeTruthy();
+ expect(findEnvironmentsDropdown().exists()).toBe(true);
});
});
@@ -83,7 +86,7 @@ describe('Dashboard', () => {
});
it('shows the environment selector dropdown', () => {
- expect(wrapper.vm.$el.querySelector('.js-environments-dropdown')).toBeTruthy();
+ expect(findEnvironmentsDropdown().exists()).toBe(true);
});
});
@@ -113,7 +116,7 @@ describe('Dashboard', () => {
.$nextTick()
.then(() => {
expect(wrapper.vm.showEmptyState).toEqual(false);
- expect(wrapper.vm.$el.querySelector('.prometheus-panel')).toEqual(null);
+ expect(wrapper.findAll('.prometheus-panel')).toHaveLength(0);
done();
})
@@ -152,9 +155,7 @@ describe('Dashboard', () => {
wrapper.vm
.$nextTick()
.then(() => {
- const environmentDropdownItems = wrapper
- .find('.js-environments-dropdown')
- .findAll(GlDropdownItem);
+ const environmentDropdownItems = findAllEnvironmentsDropdownItems();
expect(wrapper.vm.environments.length).toEqual(environmentData.length);
expect(environmentDropdownItems.length).toEqual(wrapper.vm.environments.length);
@@ -176,10 +177,7 @@ describe('Dashboard', () => {
wrapper.vm
.$nextTick()
.then(() => {
- const environmentDropdownItems = wrapper
- .find('.js-environments-dropdown')
- .findAll(GlDropdownItem);
- const activeItem = environmentDropdownItems.wrappers.filter(itemWrapper =>
+ const activeItem = findAllEnvironmentsDropdownItems().wrappers.filter(itemWrapper =>
itemWrapper.find('.active').exists(),
);
@@ -205,11 +203,7 @@ describe('Dashboard', () => {
wrapper.vm
.$nextTick()
.then(() => {
- const environmentDropdownItems = wrapper
- .find('.js-environments-dropdown')
- .findAll(GlDropdownItem);
-
- expect(environmentDropdownItems.length).toEqual(0);
+ expect(findAllEnvironmentsDropdownItems()).toHaveLength(0);
done();
})
.catch(done.fail);
diff --git a/spec/frontend/notes/components/comment_form_spec.js b/spec/frontend/notes/components/comment_form_spec.js
index ceba31b1a70..a2c7f0b3767 100644
--- a/spec/frontend/notes/components/comment_form_spec.js
+++ b/spec/frontend/notes/components/comment_form_spec.js
@@ -87,7 +87,7 @@ describe('issue_comment_form component', () => {
expect(wrapper.vm.toggleIssueState).toHaveBeenCalled();
});
- it('should disable action button whilst submitting', done => {
+ it('should disable action button while submitting', done => {
const saveNotePromise = Promise.resolve();
wrapper.vm.note = 'hello world';
jest.spyOn(wrapper.vm, 'saveNote').mockReturnValue(saveNotePromise);
diff --git a/spec/javascripts/blob/notebook/index_spec.js b/spec/javascripts/blob/notebook/index_spec.js
index 6bb5bac007f..db6ca5bd22d 100644
--- a/spec/javascripts/blob/notebook/index_spec.js
+++ b/spec/javascripts/blob/notebook/index_spec.js
@@ -94,7 +94,7 @@ describe('iPython notebook renderer', () => {
it('shows error message', () => {
expect(document.querySelector('.md').textContent.trim()).toBe(
- 'An error occurred whilst parsing the file.',
+ 'An error occurred while parsing the file.',
);
});
});
@@ -123,7 +123,7 @@ describe('iPython notebook renderer', () => {
it('shows error message', () => {
expect(document.querySelector('.md').textContent.trim()).toBe(
- 'An error occurred whilst loading the file. Please try again later.',
+ 'An error occurred while loading the file. Please try again later.',
);
});
});
diff --git a/spec/javascripts/blob/pdf/index_spec.js b/spec/javascripts/blob/pdf/index_spec.js
index 6ea097da742..66769a8aa47 100644
--- a/spec/javascripts/blob/pdf/index_spec.js
+++ b/spec/javascripts/blob/pdf/index_spec.js
@@ -65,7 +65,7 @@ describe('PDF renderer', () => {
it('shows error message', () => {
expect(document.querySelector('.md').textContent.trim()).toBe(
- 'An error occurred whilst loading the file. Please try again later.',
+ 'An error occurred while loading the file. Please try again later.',
);
});
});
diff --git a/spec/javascripts/ide/stores/actions/merge_request_spec.js b/spec/javascripts/ide/stores/actions/merge_request_spec.js
index ca8f33407fd..ee0e51003c5 100644
--- a/spec/javascripts/ide/stores/actions/merge_request_spec.js
+++ b/spec/javascripts/ide/stores/actions/merge_request_spec.js
@@ -180,7 +180,7 @@ describe('IDE store merge request actions', () => {
.then(done.fail)
.catch(() => {
expect(dispatch).toHaveBeenCalledWith('setErrorMessage', {
- text: 'An error occurred whilst loading the merge request.',
+ text: 'An error occurred while loading the merge request.',
action: jasmine.any(Function),
actionText: 'Please try again',
actionPayload: {
@@ -253,7 +253,7 @@ describe('IDE store merge request actions', () => {
.then(done.fail)
.catch(() => {
expect(dispatch).toHaveBeenCalledWith('setErrorMessage', {
- text: 'An error occurred whilst loading the merge request changes.',
+ text: 'An error occurred while loading the merge request changes.',
action: jasmine.any(Function),
actionText: 'Please try again',
actionPayload: {
@@ -323,7 +323,7 @@ describe('IDE store merge request actions', () => {
.then(done.fail)
.catch(() => {
expect(dispatch).toHaveBeenCalledWith('setErrorMessage', {
- text: 'An error occurred whilst loading the merge request version data.',
+ text: 'An error occurred while loading the merge request version data.',
action: jasmine.any(Function),
actionText: 'Please try again',
actionPayload: {
diff --git a/spec/javascripts/ide/stores/actions/tree_spec.js b/spec/javascripts/ide/stores/actions/tree_spec.js
index be350b6f6cc..fabe44ce333 100644
--- a/spec/javascripts/ide/stores/actions/tree_spec.js
+++ b/spec/javascripts/ide/stores/actions/tree_spec.js
@@ -125,7 +125,7 @@ describe('Multi-file store tree actions', () => {
.then(done.fail)
.catch(() => {
expect(dispatch).toHaveBeenCalledWith('setErrorMessage', {
- text: 'An error occurred whilst loading all the files.',
+ text: 'An error occurred while loading all the files.',
action: jasmine.any(Function),
actionText: 'Please try again',
actionPayload: { projectId: 'abc/def', branchId: 'master-testing' },
diff --git a/spec/support/shared_examples/features/discussion_comments_shared_example.rb b/spec/support/shared_examples/features/discussion_comments_shared_example.rb
index f8d2fdece7d..257b53b2a7b 100644
--- a/spec/support/shared_examples/features/discussion_comments_shared_example.rb
+++ b/spec/support/shared_examples/features/discussion_comments_shared_example.rb
@@ -275,13 +275,15 @@ RSpec.shared_examples 'thread comments' do |resource_name|
find("#{menu_selector} li", match: :first)
items = all("#{menu_selector} li")
- expect(items.first).to have_content 'Comment'
- expect(items.first).to have_selector '.fa-check'
- expect(items.first['class']).to match 'droplab-item-selected'
-
- expect(items.last).to have_content 'Start thread'
- expect(items.last).not_to have_selector '.fa-check'
- expect(items.last['class']).not_to match 'droplab-item-selected'
+ aggregate_failures do
+ expect(items.first).to have_content 'Comment'
+ expect(items.first).to have_selector '.fa-check'
+ expect(items.first['class']).to match 'droplab-item-selected'
+
+ expect(items.last).to have_content 'Start thread'
+ expect(items.last).not_to have_selector '.fa-check'
+ expect(items.last['class']).not_to match 'droplab-item-selected'
+ end
end
end
end