Skip to content
Snippets Groups Projects
Commit 143f196f authored by GitLab Bot's avatar GitLab Bot
Browse files

Add latest changes from gitlab-org/gitlab@master

parent 575ccb03
No related branches found
No related tags found
No related merge requests found
Showing
with 60 additions and 64 deletions
Loading
Loading
@@ -13,8 +13,6 @@ describe 'Projects > Files > User creates a directory', :js do
let(:user) { create(:user) }
 
before do
stub_feature_flags(vue_file_list: false)
project.add_developer(user)
sign_in(user)
visit project_tree_path(project, 'master')
Loading
Loading
Loading
Loading
@@ -2,7 +2,7 @@
 
require 'spec_helper'
 
describe 'Projects > Files > User creates files' do
describe 'Projects > Files > User creates files', :js do
let(:fork_message) do
"You're not allowed to make changes to this project directly. "\
"A fork of this project has been created that you can make changes in, so you can submit a merge request."
Loading
Loading
@@ -14,7 +14,6 @@ describe 'Projects > Files > User creates files' do
let(:user) { create(:user) }
 
before do
stub_feature_flags(vue_file_list: false)
stub_feature_flags(web_ide_default: false)
 
project.add_maintainer(user)
Loading
Loading
@@ -68,8 +67,7 @@ describe 'Projects > Files > User creates files' do
file_name = find('#file_name')
file_name.set options[:file_name] || 'README.md'
 
file_content = find('#file-content', visible: false)
file_content.set options[:file_content] || 'Some content'
find('.ace_text-input', visible: false).send_keys.native.send_keys options[:file_content] || 'Some content'
 
click_button 'Commit changes'
end
Loading
Loading
@@ -89,7 +87,7 @@ describe 'Projects > Files > User creates files' do
expect(page).to have_content 'Path cannot include directory traversal'
end
 
it 'creates and commit a new file', :js do
it 'creates and commit a new file' do
find('#editor')
execute_script("ace.edit('editor').setValue('*.rbca')")
fill_in(:file_name, with: 'not_a_file.md')
Loading
Loading
@@ -105,7 +103,7 @@ describe 'Projects > Files > User creates files' do
expect(page).to have_content('*.rbca')
end
 
it 'creates and commit a new file with new lines at the end of file', :js do
it 'creates and commit a new file with new lines at the end of file' do
find('#editor')
execute_script('ace.edit("editor").setValue("Sample\n\n\n")')
fill_in(:file_name, with: 'not_a_file.md')
Loading
Loading
@@ -122,7 +120,7 @@ describe 'Projects > Files > User creates files' do
expect(evaluate_script('ace.edit("editor").getValue()')).to eq("Sample\n\n\n")
end
 
it 'creates and commit a new file with a directory name', :js do
it 'creates and commit a new file with a directory name' do
fill_in(:file_name, with: 'foo/bar/baz.txt')
 
expect(page).to have_selector('.file-editor')
Loading
Loading
@@ -139,7 +137,7 @@ describe 'Projects > Files > User creates files' do
expect(page).to have_content('*.rbca')
end
 
it 'creates and commit a new file specifying a new branch', :js do
it 'creates and commit a new file specifying a new branch' do
expect(page).to have_selector('.file-editor')
 
find('#editor')
Loading
Loading
@@ -174,7 +172,7 @@ describe 'Projects > Files > User creates files' do
expect(page).to have_content(message)
end
 
it 'creates and commit new file in forked project', :js do
it 'creates and commit new file in forked project' do
expect(page).to have_selector('.file-editor')
 
find('#editor')
Loading
Loading
Loading
Loading
@@ -14,8 +14,6 @@ describe 'Projects > Files > User deletes files', :js do
let(:user) { create(:user) }
 
before do
stub_feature_flags(vue_file_list: false)
sign_in(user)
end
 
Loading
Loading
Loading
Loading
@@ -12,7 +12,6 @@ describe 'Projects > Files > User edits files', :js do
 
before do
stub_feature_flags(web_ide_default: false)
stub_feature_flags(vue_file_list: false)
 
sign_in(user)
end
Loading
Loading
Loading
Loading
@@ -16,8 +16,6 @@ describe 'Projects > Files > User replaces files', :js do
let(:user) { create(:user) }
 
before do
stub_feature_flags(vue_file_list: false)
sign_in(user)
end
 
Loading
Loading
Loading
Loading
@@ -16,8 +16,6 @@ describe 'Projects > Files > User uploads files' do
let(:project2_tree_path_root_ref) { project_tree_path(project2, project2.repository.root_ref) }
 
before do
stub_feature_flags(vue_file_list: false)
project.add_maintainer(user)
sign_in(user)
end
Loading
Loading
Loading
Loading
@@ -2,12 +2,11 @@
 
require 'spec_helper'
 
describe 'Projects > Show > Collaboration links' do
describe 'Projects > Show > Collaboration links', :js do
let(:project) { create(:project, :repository) }
let(:user) { create(:user) }
 
before do
stub_feature_flags(vue_file_list: false)
project.add_developer(user)
sign_in(user)
end
Loading
Loading
@@ -17,15 +16,21 @@ describe 'Projects > Show > Collaboration links' do
 
# The navigation bar
page.within('.header-new') do
find('.qa-new-menu-toggle').click
aggregate_failures 'dropdown links in the navigation bar' do
expect(page).to have_link('New issue')
expect(page).to have_link('New merge request')
expect(page).to have_link('New snippet', href: new_project_snippet_path(project))
end
find('.qa-new-menu-toggle').click
end
 
# The dropdown above the tree
page.within('.repo-breadcrumb') do
find('.qa-add-to-tree').click
aggregate_failures 'dropdown links above the repo tree' do
expect(page).to have_link('New file')
expect(page).to have_link('Upload file')
Loading
Loading
@@ -45,23 +50,19 @@ describe 'Projects > Show > Collaboration links' do
visit project_path(project)
 
page.within('.header-new') do
find('.qa-new-menu-toggle').click
aggregate_failures 'dropdown links' do
expect(page).not_to have_link('New issue')
expect(page).not_to have_link('New merge request')
expect(page).not_to have_link('New snippet', href: new_project_snippet_path(project))
end
end
 
page.within('.repo-breadcrumb') do
aggregate_failures 'dropdown links' do
expect(page).not_to have_link('New file')
expect(page).not_to have_link('Upload file')
expect(page).not_to have_link('New directory')
expect(page).not_to have_link('New branch')
expect(page).not_to have_link('New tag')
end
find('.qa-new-menu-toggle').click
end
 
expect(page).not_to have_selector('.qa-add-to-tree')
expect(page).not_to have_link('Web IDE')
end
end
Loading
Loading
@@ -5,10 +5,6 @@ require 'spec_helper'
describe 'Projects > Show > User sees last commit CI status' do
set(:project) { create(:project, :repository, :public) }
 
before do
stub_feature_flags(vue_file_list: false)
end
it 'shows the project README', :js do
project.enable_ci
pipeline = create(:ci_pipeline, project: project, sha: project.commit.sha, ref: 'master')
Loading
Loading
@@ -16,9 +12,9 @@ describe 'Projects > Show > User sees last commit CI status' do
 
visit project_path(project)
 
page.within '.blob-commit-info' do
page.within '.commit-detail' do
expect(page).to have_content(project.commit.sha[0..6])
expect(page).to have_link('Pipeline: skipped')
expect(page).to have_selector('[aria-label="Commit: skipped"]')
end
end
end
Loading
Loading
@@ -59,8 +59,8 @@ describe 'Projects > Show > User sees setup shortcut buttons' do
end
 
it '"Add license" button linked to new file populated for a license' do
page.within('.project-stats') do
expect(page).to have_link('Add license', href: presenter.add_license_path)
page.within('.project-buttons') do
expect(page).to have_link('Add LICENSE', href: presenter.add_license_path)
end
end
end
Loading
Loading
@@ -175,7 +175,7 @@ describe 'Projects > Show > User sees setup shortcut buttons' do
expect(project.repository.license_blob).not_to be_nil
 
page.within('.project-buttons') do
expect(page).not_to have_link('Add license')
expect(page).not_to have_link('Add LICENSE')
end
end
 
Loading
Loading
Loading
Loading
@@ -10,7 +10,6 @@ describe 'Projects tree', :js do
let(:test_sha) { '7975be0116940bf2ad4321f79d02a55c5f7779aa' }
 
before do
stub_feature_flags(vue_file_list: false)
project.add_maintainer(user)
sign_in(user)
end
Loading
Loading
Loading
Loading
@@ -6,10 +6,6 @@ describe 'Project' do
include ProjectForksHelper
include MobileHelpers
 
before do
stub_feature_flags(vue_file_list: false)
end
describe 'creating from template' do
let(:user) { create(:user) }
let(:template) { Gitlab::ProjectTemplate.find(:rails) }
Loading
Loading
@@ -272,7 +268,7 @@ describe 'Project' do
end
end
 
describe 'tree view (default view is set to Files)' do
describe 'tree view (default view is set to Files)', :js do
let(:user) { create(:user, project_view: 'files') }
let(:project) { create(:forked_project_with_submodules) }
 
Loading
Loading
@@ -285,19 +281,19 @@ describe 'Project' do
it 'has working links to files' do
click_link('PROCESS.md')
 
expect(page.status_code).to eq(200)
expect(page).to have_selector('.file-holder')
end
 
it 'has working links to directories' do
click_link('encoding')
 
expect(page.status_code).to eq(200)
expect(page).to have_selector('.breadcrumb-item', text: 'encoding')
end
 
it 'has working links to submodules' do
click_link('645f6c4c')
 
expect(page.status_code).to eq(200)
expect(page).to have_selector('.qa-branches-select', text: '645f6c4c82fd3f5e06f67134450a570b795e55a6')
end
 
context 'for signed commit on default branch', :js do
Loading
Loading
Loading
Loading
@@ -173,13 +173,5 @@ describe 'GPG signed commits' do
context 'with vue tree view enabled' do
it_behaves_like 'a commit with a signature'
end
context 'with vue tree view disabled' do
before do
stub_feature_flags(vue_file_list: false)
end
it_behaves_like 'a commit with a signature'
end
end
end
Loading
Loading
@@ -9,6 +9,7 @@ let $apollo;
const MOCK_BLOBS = [
{
id: '123abc',
sha: '123abc',
flatPath: 'blob',
name: 'blob.md',
type: 'blob',
Loading
Loading
@@ -16,6 +17,7 @@ const MOCK_BLOBS = [
},
{
id: '124abc',
sha: '124abc',
flatPath: 'blob2',
name: 'blob2.md',
type: 'blob',
Loading
Loading
Loading
Loading
@@ -41,6 +41,7 @@ describe('Repository table row component', () => {
it('renders table row', () => {
factory({
id: '1',
sha: '123',
path: 'test',
type: 'file',
currentPath: '/',
Loading
Loading
@@ -57,6 +58,7 @@ describe('Repository table row component', () => {
`('renders a $componentName for type $type', ({ type, component }) => {
factory({
id: '1',
sha: '123',
path: 'test',
type,
currentPath: '/',
Loading
Loading
@@ -73,6 +75,7 @@ describe('Repository table row component', () => {
`('pushes new router if type $type is tree', ({ type, pushes }) => {
factory({
id: '1',
sha: '123',
path: 'test',
type,
currentPath: '/',
Loading
Loading
@@ -95,6 +98,7 @@ describe('Repository table row component', () => {
`('calls visitUrl if $type is not tree', ({ type, pushes }) => {
factory({
id: '1',
sha: '123',
path: 'test',
type,
currentPath: '/',
Loading
Loading
@@ -112,6 +116,7 @@ describe('Repository table row component', () => {
it('renders commit ID for submodule', () => {
factory({
id: '1',
sha: '123',
path: 'test',
type: 'commit',
currentPath: '/',
Loading
Loading
@@ -123,6 +128,7 @@ describe('Repository table row component', () => {
it('renders link with href', () => {
factory({
id: '1',
sha: '123',
path: 'test',
type: 'blob',
url: 'https://test.com',
Loading
Loading
@@ -135,6 +141,7 @@ describe('Repository table row component', () => {
it('renders LFS badge', () => {
factory({
id: '1',
sha: '123',
path: 'test',
type: 'commit',
currentPath: '/',
Loading
Loading
@@ -147,6 +154,7 @@ describe('Repository table row component', () => {
it('renders commit and web links with href for submodule', () => {
factory({
id: '1',
sha: '123',
path: 'test',
type: 'commit',
url: 'https://test.com',
Loading
Loading
@@ -161,6 +169,7 @@ describe('Repository table row component', () => {
it('renders lock icon', () => {
factory({
id: '1',
sha: '123',
path: 'test',
type: 'tree',
currentPath: '/',
Loading
Loading
Loading
Loading
@@ -41,7 +41,7 @@ describe('fetchLogsTree', () => {
 
jest.spyOn(axios, 'get');
 
global.gon = { gitlab_url: 'https://test.com' };
global.gon = { relative_url_root: '' };
 
client = {
readQuery: () => ({
Loading
Loading
@@ -64,10 +64,9 @@ describe('fetchLogsTree', () => {
 
it('calls axios get', () =>
fetchLogsTree(client, '', '0', resolver).then(() => {
expect(axios.get).toHaveBeenCalledWith(
'https://test.com/gitlab-org/gitlab-foss/refs/master/logs_tree/',
{ params: { format: 'json', offset: '0' } },
);
expect(axios.get).toHaveBeenCalledWith('/gitlab-org/gitlab-foss/refs/master/logs_tree/', {
params: { format: 'json', offset: '0' },
});
}));
 
it('calls axios get once', () =>
Loading
Loading
Loading
Loading
@@ -99,6 +99,19 @@ describe Resolvers::IssuesResolver do
expect(resolve_issues(sort: :due_date_desc)).to eq [due_issue1, due_issue3, due_issue4, due_issue2]
end
end
context 'when sorting by relative position' do
let(:project) { create(:project) }
let!(:relative_issue1) { create(:issue, project: project, relative_position: 2000) }
let!(:relative_issue2) { create(:issue, project: project, relative_position: nil) }
let!(:relative_issue3) { create(:issue, project: project, relative_position: 1000) }
let!(:relative_issue4) { create(:issue, project: project, relative_position: nil) }
it 'sorts issues ascending' do
expect(resolve_issues(sort: :relative_position_asc)).to eq [relative_issue3, relative_issue1, relative_issue4, relative_issue2]
end
end
end
 
it 'returns issues user can see' do
Loading
Loading
Loading
Loading
@@ -10,7 +10,7 @@ describe GitlabSchema.types['Commit'] do
it 'contains attributes related to commit' do
expect(described_class).to have_graphql_fields(
:id, :sha, :title, :description, :message, :authored_date,
:author, :web_url, :latest_pipeline, :pipelines, :signature_html
:author_name, :author, :web_url, :latest_pipeline, :pipelines, :signature_html
)
end
end
Loading
Loading
@@ -8,6 +8,6 @@ describe GitlabSchema.types['IssueSort'] do
it_behaves_like 'common sort values'
 
it 'exposes all the existing issue sort values' do
expect(described_class.values.keys).to include(*%w[DUE_DATE_ASC DUE_DATE_DESC])
expect(described_class.values.keys).to include(*%w[DUE_DATE_ASC DUE_DATE_DESC RELATIVE_POSITION_ASC])
end
end
Loading
Loading
@@ -5,5 +5,5 @@ require 'spec_helper'
describe Types::Tree::BlobType do
it { expect(described_class.graphql_name).to eq('Blob') }
 
it { expect(described_class).to have_graphql_fields(:id, :name, :type, :path, :flat_path, :web_url, :lfs_oid) }
it { expect(described_class).to have_graphql_fields(:id, :sha, :name, :type, :path, :flat_path, :web_url, :lfs_oid) }
end
Loading
Loading
@@ -5,5 +5,5 @@ require 'spec_helper'
describe Types::Tree::SubmoduleType do
it { expect(described_class.graphql_name).to eq('Submodule') }
 
it { expect(described_class).to have_graphql_fields(:id, :name, :type, :path, :flat_path, :web_url, :tree_url) }
it { expect(described_class).to have_graphql_fields(:id, :sha, :name, :type, :path, :flat_path, :web_url, :tree_url) }
end
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment