Commit 58bb22c1 authored by Bob Van Landuyt's avatar Bob Van Landuyt

Merge branch 'ph/enableVueFileListFlag' into 'master'

Enable Vue file list feature flag for tests

See merge request gitlab-org/gitlab!18954
parents 2c6fc1a0 1a370d44
<script>
import { GlTooltipDirective, GlLink, GlButton, GlLoadingIcon } from '@gitlab/ui';
import defaultAvatarUrl from 'images/no_avatar.png';
import { sprintf, s__ } from '~/locale';
import Icon from '../../vue_shared/components/icon.vue';
import UserAvatarLink from '../../vue_shared/components/user_avatar/user_avatar_link.vue';
......@@ -83,6 +84,7 @@ export default {
this.showDescription = !this.showDescription;
},
},
defaultAvatarUrl,
};
</script>
......@@ -97,6 +99,9 @@ export default {
:img-size="40"
class="avatar-cell"
/>
<span v-else class="avatar-cell user-avatar-link">
<img :src="$options.defaultAvatarUrl" width="40" height="40" class="avatar s40" />
</span>
<div class="commit-detail flex-list">
<div class="commit-content qa-commit-content">
<gl-link :href="commit.webUrl" class="commit-row-message item-title">
......@@ -119,6 +124,9 @@ export default {
>
{{ commit.author.name }}
</gl-link>
<template v-else>
{{ commit.authorName }}
</template>
{{ s__('LastCommit|authored') }}
<timeago-tooltip :time="commit.authoredDate" tooltip-placement="bottom" />
</div>
......@@ -132,9 +140,8 @@ export default {
</div>
<div class="commit-actions flex-row">
<div v-if="commit.signatureHtml" v-html="commit.signatureHtml"></div>
<div class="ci-status-link">
<div v-if="commit.pipeline" class="ci-status-link">
<gl-link
v-if="commit.pipeline"
v-gl-tooltip.left
:href="commit.pipeline.detailedStatus.detailsPath"
:title="statusTitle"
......
......@@ -75,6 +75,7 @@ export default {
v-for="entry in val"
:id="entry.id"
:key="`${entry.flatPath}-${entry.id}`"
:sha="entry.sha"
:project-path="projectPath"
:current-path="path"
:name="entry.name"
......
......@@ -37,6 +37,10 @@ export default {
type: String,
required: true,
},
sha: {
type: String,
required: true,
},
projectPath: {
type: String,
required: true,
......@@ -98,7 +102,7 @@ export default {
return this.path.replace(new RegExp(`^${this.currentPath}/`), '');
},
shortSha() {
return this.id.slice(0, 8);
return this.sha.slice(0, 8);
},
hasLockLabel() {
return this.commit && this.commit.lockLabel;
......
......@@ -26,9 +26,12 @@ export function fetchLogsTree(client, path, offset, resolver = null) {
const { ref } = client.readQuery({ query: getRef });
fetchpromise = axios
.get(`${gon.gitlab_url}/${projectPath}/refs/${ref}/logs_tree/${path.replace(/^\//, '')}`, {
params: { format: 'json', offset },
})
.get(
`${gon.relative_url_root}/${projectPath}/refs/${ref}/logs_tree/${path.replace(/^\//, '')}`,
{
params: { format: 'json', offset },
},
)
.then(({ data, headers }) => {
const headerLogsOffset = headers['more-logs-offset'];
const { commits } = client.readQuery({ query: getCommits });
......
......@@ -2,6 +2,7 @@
fragment TreeEntry on Entry {
id
sha
name
flatPath
type
......
......@@ -8,6 +8,7 @@ query pathLastCommit($projectPath: ID!, $path: String, $ref: String!) {
description
webUrl
authoredDate
authorName
author {
name
avatarUrl
......
......@@ -24,6 +24,8 @@ module Types
description: 'Web URL of the commit'
field :signature_html, type: GraphQL::STRING_TYPE, null: true, calls_gitaly: true,
description: 'Rendered HTML of the commit signature'
field :author_name, type: GraphQL::STRING_TYPE, null: true,
description: 'Commit authors name'
# models/commit lazy loads the author by email
field :author, type: Types::UserType, null: true,
......
......@@ -5,6 +5,7 @@ module Types
include Types::BaseInterface
field :id, GraphQL::ID_TYPE, null: false # rubocop:disable Graphql/Descriptions
field :sha, GraphQL::STRING_TYPE, null: false, description: "Last commit sha for entry", method: :id
field :name, GraphQL::STRING_TYPE, null: false # rubocop:disable Graphql/Descriptions
field :type, Tree::TypeEnum, null: false # rubocop:disable Graphql/Descriptions
field :path, GraphQL::STRING_TYPE, null: false # rubocop:disable Graphql/Descriptions
......
......@@ -76,6 +76,11 @@ type Blob implements Entry {
lfsOid: String
name: String!
path: String!
"""
Last commit sha for entry
"""
sha: String!
type: EntryType!
webUrl: String
}
......@@ -121,6 +126,11 @@ type Commit {
"""
author: User
"""
Commit authors name
"""
authorName: String
"""
Timestamp of when the commit was authored
"""
......@@ -1100,6 +1110,11 @@ interface Entry {
id: ID!
name: String!
path: String!
"""
Last commit sha for entry
"""
sha: String!
type: EntryType!
}
......@@ -4772,6 +4787,11 @@ type Submodule implements Entry {
id: ID!
name: String!
path: String!
"""
Last commit sha for entry
"""
sha: String!
treeUrl: String
type: EntryType!
webUrl: String
......@@ -5118,6 +5138,11 @@ type TreeEntry implements Entry {
id: ID!
name: String!
path: String!
"""
Last commit sha for entry
"""
sha: String!
type: EntryType!
webUrl: String
}
......
......@@ -10227,6 +10227,20 @@
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "authorName",
"description": "Commit authors name",
"args": [
],
"type": {
"kind": "SCALAR",
"name": "String",
"ofType": null
},
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "authoredDate",
"description": "Timestamp of when the commit was authored",
......@@ -11332,6 +11346,24 @@
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "sha",
"description": "Last commit sha for entry",
"args": [
],
"type": {
"kind": "NON_NULL",
"name": null,
"ofType": {
"kind": "SCALAR",
"name": "String",
"ofType": null
}
},
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "type",
"description": null,
......@@ -11453,6 +11485,24 @@
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "sha",
"description": "Last commit sha for entry",
"args": [
],
"type": {
"kind": "NON_NULL",
"name": null,
"ofType": {
"kind": "SCALAR",
"name": "String",
"ofType": null
}
},
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "type",
"description": null,
......@@ -11711,6 +11761,24 @@
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "sha",
"description": "Last commit sha for entry",
"args": [
],
"type": {
"kind": "NON_NULL",
"name": null,
"ofType": {
"kind": "SCALAR",
"name": "String",
"ofType": null
}
},
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "treeUrl",
"description": null,
......@@ -11972,6 +12040,24 @@
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "sha",
"description": "Last commit sha for entry",
"args": [
],
"type": {
"kind": "NON_NULL",
"name": null,
"ofType": {
"kind": "SCALAR",
"name": "String",
"ofType": null
}
},
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "type",
"description": null,
......
......@@ -36,6 +36,7 @@ The API can be explored interactively using the [GraphiQL IDE](../index.md#graph
| Name | Type | Description |
| --- | ---- | ---------- |
| `id` | ID! | |
| `sha` | String! | Last commit sha for entry |
| `name` | String! | |
| `type` | EntryType! | |
| `path` | String! | |
......@@ -55,6 +56,7 @@ The API can be explored interactively using the [GraphiQL IDE](../index.md#graph
| `authoredDate` | Time | Timestamp of when the commit was authored |
| `webUrl` | String! | Web URL of the commit |
| `signatureHtml` | String | Rendered HTML of the commit signature |
| `authorName` | String | Commit authors name |
| `author` | User | Author of the commit |
| `latestPipeline` | Pipeline | Latest pipeline of the commit |
......@@ -738,6 +740,7 @@ The API can be explored interactively using the [GraphiQL IDE](../index.md#graph
| Name | Type | Description |
| --- | ---- | ---------- |
| `id` | ID! | |
| `sha` | String! | Last commit sha for entry |
| `name` | String! | |
| `type` | EntryType! | |
| `path` | String! | |
......@@ -794,6 +797,7 @@ The API can be explored interactively using the [GraphiQL IDE](../index.md#graph
| Name | Type | Description |
| --- | ---- | ---------- |
| `id` | ID! | |
| `sha` | String! | Last commit sha for entry |
| `name` | String! | |
| `type` | EntryType! | |
| `path` | String! | |
......
......@@ -7,13 +7,11 @@ describe 'Projects > Files > User views files page' do
let(:user) { project.owner }
before do
stub_feature_flags(vue_file_list: false)
sign_in user
visit project_tree_path(project, project.repository.root_ref)
end
it 'user sees folders and submodules sorted together, followed by files' do
it 'user sees folders and submodules sorted together, followed by files', :js do
rows = all('td.tree-item-file-name').map(&:text)
tree = project.repository.tree
......
......@@ -7,7 +7,6 @@ describe 'Projects > Files > Project owner creates a license file', :js do
let(:project_maintainer) { project.owner }
before do
stub_feature_flags(vue_file_list: false)
project.repository.delete_file(project_maintainer, 'LICENSE',
message: 'Remove LICENSE', branch_name: 'master')
sign_in(project_maintainer)
......
......@@ -13,23 +13,22 @@ describe "User browses files" do
let(:user) { project.owner }
before do
stub_feature_flags(vue_file_list: false)
sign_in(user)
end
it "shows last commit for current directory" do
it "shows last commit for current directory", :js do
visit(tree_path_root_ref)
click_link("files")
last_commit = project.repository.last_commit_for_path(project.default_branch, "files")
page.within(".blob-commit-info") do
page.within(".commit-detail") do
expect(page).to have_content(last_commit.short_id).and have_content(last_commit.author_name)
end
end
context "when browsing the master branch" do
context "when browsing the master branch", :js do
before do
visit(tree_path_root_ref)
end
......@@ -124,8 +123,7 @@ describe "User browses files" do
expect(current_path).to eq(project_tree_path(project, "markdown/doc/raketasks"))
expect(page).to have_content("backup_restore.md").and have_content("maintenance.md")
click_link("shop")
click_link("Maintenance")
click_link("maintenance.md")
expect(current_path).to eq(project_blob_path(project, "markdown/doc/raketasks/maintenance.md"))
expect(page).to have_content("bundle exec rake gitlab:env:info RAILS_ENV=production")
......@@ -144,7 +142,7 @@ describe "User browses files" do
# rubocop:disable Lint/Void
# Test the full URLs of links instead of relative paths by `have_link(text: "...", href: "...")`.
find("a", text: /^empty$/)["href"] == project_tree_url(project, "markdown/d")
find("a", text: "..")["href"] == project_tree_url(project, "markdown/d")
# rubocop:enable Lint/Void
page.within(".tree-table") do
......@@ -168,7 +166,7 @@ describe "User browses files" do
end
end
context "when browsing a specific ref" do
context "when browsing a specific ref", :js do
let(:ref) { project_tree_path(project, "6d39438") }
before do
......@@ -180,7 +178,7 @@ describe "User browses files" do
expect(page).to have_content(".gitignore").and have_content("LICENSE")
end
it "shows files from a repository with apostroph in its name", :js do
it "shows files from a repository with apostroph in its name" do
first(".js-project-refs-dropdown").click
page.within(".project-refs-form") do
......@@ -191,10 +189,10 @@ describe "User browses files" do
visit(project_tree_path(project, "'test'"))
expect(page).to have_css(".tree-commit-link").and have_no_content("Loading commit data...")
expect(page).not_to have_selector(".tree-commit .animation-container")
end
it "shows the code with a leading dot in the directory", :js do
it "shows the code with a leading dot in the directory" do
first(".js-project-refs-dropdown").click
page.within(".project-refs-form") do
......@@ -203,7 +201,7 @@ describe "User browses files" do
visit(project_tree_path(project, "fix/.testdir"))
expect(page).to have_css(".tree-commit-link").and have_no_content("Loading commit data...")
expect(page).not_to have_selector(".tree-commit .animation-container")
end
it "does not show the permalink link" do
......@@ -221,7 +219,7 @@ describe "User browses files" do
click_link(".gitignore")
end
it "shows a file content", :js do
it "shows a file content" do
expect(page).to have_content("*.rbc")
end
......
......@@ -7,8 +7,6 @@ describe 'Projects > Files > User browses LFS files' do
let(:user) { project.owner }
before do
stub_feature_flags(vue_file_list: false)
sign_in(user)
end
......
......@@ -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')
......
......@@ -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."
......@@ -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)
......@@ -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
......@@ -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')
......@@ -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')
......@@ -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')
......@@ -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')
......@@ -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')
......
......@@ -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
......
......@@ -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
......
......@@ -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
......
......@@ -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
......
......@@ -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
......@@ -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')
......@@ -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
......@@ -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')
......@@ -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
......@@ -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
......
......@@ -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) }
......@@ -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) }
......@@ -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
......
......@@ -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
......@@ -9,6 +9,7 @@ let $apollo;
const MOCK_BLOBS = [
{
id: '123abc',
sha: '123abc',
flatPath: 'blob',
name: 'blob.md',
type: 'blob',
......@@ -16,6 +17,7 @@ const MOCK_BLOBS = [
},
{
id: '124abc',
sha: '124abc',
flatPath: 'blob2',
name: 'blob2.md',
type: 'blob',
......
......@@ -41,6 +41,7 @@ describe('Repository table row component', () => {
it('renders table row', () => {
factory({
id: '1',
sha: '123',
path: 'test',
type: 'file',
currentPath: '/',
......@@ -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: '/',
......@@ -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: '/',
......@@ -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: '/',
......@@ -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: '/',
......@@ -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',
......@@ -135,6 +141,7 @@ describe('Repository table row component', () => {
it('renders LFS badge', () => {
factory({
id: '1',
sha: '123',
path: 'test',
type: 'commit',
currentPath: '/',
......@@ -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',
......@@ -161,6 +169,7 @@ describe('Repository table row component', () => {
it('renders lock icon', () => {
factory({
id: '1',
sha: '123',
path: 'test',
type: 'tree',
currentPath: '/',
......
......@@ -41,7 +41,7 @@ describe('fetchLogsTree', () => {
jest.spyOn(axios, 'get');
global.gon = { gitlab_url: 'https://test.com' };
global.gon = { relative_url_root: '' };
client = {
readQuery: () => ({
......@@ -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', () =>
......
......@@ -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
......@@ -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
......@@ -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
......@@ -5,5 +5,5 @@ require 'spec_helper'
describe Types::Tree::TreeEntryType do
it { expect(described_class.graphql_name).to eq('TreeEntry') }
it { expect(described_class).to have_graphql_fields(:id, :name, :type, :path, :flat_path, :web_url) }
it { expect(described_class).to have_graphql_fields(:id, :sha, :name, :type, :path, :flat_path, :web_url) }
end
......@@ -18,6 +18,14 @@ describe 'projects/show' do
end
context 'commit signatures' do
context 'with vue tree view enabled' do
it 'are not rendered via js-signature-container' do
render
expect(rendered).not_to have_css('.js-signature-container')
end
end
context 'with vue tree view disabled' do
before do
stub_feature_flags(vue_file_list: false)
......@@ -29,13 +37,5 @@ describe 'projects/show' do
expect(rendered).to have_css('.js-signature-container')
end
end
context 'with vue tree view enabled' do
it 'are not rendered via js-signature-container' do
render
expect(rendered).not_to have_css('.js-signature-container')
end
end
end
end
......@@ -13,8 +13,6 @@ describe 'projects/tree/show' do
let(:tree) { repository.tree(commit.id, path) }
before do
stub_feature_flags(vue_file_list: false)
assign(:project, project)
assign(:repository, repository)
assign(:lfs_blob_ids, [])
......@@ -39,12 +37,15 @@ describe 'projects/tree/show' do
render
expect(rendered).to have_css('.js-project-refs-dropdown .dropdown-toggle-text', text: ref)
expect(rendered).to have_css('.readme-holder')
end
end
context 'commit signatures' do
context 'with vue tree view disabled' do
before do
stub_feature_flags(vue_file_list: false)
end
it 'rendered via js-signature-container' do
render
......@@ -53,10 +54,6 @@ describe 'projects/tree/show' do
end
context 'with vue tree view enabled' do
before do
stub_feature_flags(vue_file_list: true)
end
it 'are not rendered via js-signature-container' do
render
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment