Add latest changes from gitlab-org/gitlab@master
This commit is contained in:
parent
0afa6fb9d9
commit
ca6f7d9e72
|
|
@ -22,6 +22,7 @@ export default {
|
|||
return {
|
||||
nodes,
|
||||
statuses: Array.isArray(args.statuses) ? [...args.statuses] : args.statuses,
|
||||
pageInfo: incoming.pageInfo,
|
||||
};
|
||||
},
|
||||
},
|
||||
|
|
|
|||
|
|
@ -367,6 +367,8 @@ function handleContinueList(e, textArea) {
|
|||
export function keypressNoteText(e) {
|
||||
const textArea = this;
|
||||
|
||||
if ($(textArea).atwho?.('isSelecting')) return;
|
||||
|
||||
handleContinueList(e, textArea);
|
||||
handleSurroundSelectedText(e, textArea);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -174,14 +174,14 @@ export default {
|
|||
<div class="gl-mb-2">
|
||||
<gl-link
|
||||
:href="pipeline.path"
|
||||
class="gl-text-decoration-underline gl-text-blue-600!"
|
||||
class="gl-text-decoration-underline gl-text-blue-600! gl-mr-3"
|
||||
data-testid="pipeline-url-link"
|
||||
data-qa-selector="pipeline_url_link"
|
||||
>
|
||||
#{{ pipeline[pipelineKey] }}
|
||||
</gl-link>
|
||||
<!--Commit row-->
|
||||
<div class="icon-container gl-display-inline-block">
|
||||
<div class="icon-container gl-display-inline-block gl-mr-1">
|
||||
<gl-icon
|
||||
v-gl-tooltip
|
||||
:name="commitIcon"
|
||||
|
|
@ -193,18 +193,18 @@ export default {
|
|||
<gl-link
|
||||
v-if="mergeRequestRef"
|
||||
:href="mergeRequestRef.path"
|
||||
class="ref-name"
|
||||
class="ref-name gl-mr-3"
|
||||
data-testid="merge-request-ref"
|
||||
>{{ mergeRequestRef.iid }}</gl-link
|
||||
>
|
||||
<gl-link v-else :href="refUrl" class="ref-name" data-testid="commit-ref-name">{{
|
||||
<gl-link v-else :href="refUrl" class="ref-name gl-mr-3" data-testid="commit-ref-name">{{
|
||||
commitRef.name
|
||||
}}</gl-link>
|
||||
</tooltip-on-truncate>
|
||||
<gl-icon
|
||||
v-gl-tooltip
|
||||
name="commit"
|
||||
class="commit-icon"
|
||||
class="commit-icon gl-mr-1"
|
||||
:title="__('Commit')"
|
||||
data-testid="commit-icon"
|
||||
/>
|
||||
|
|
|
|||
|
|
@ -6,4 +6,6 @@ remove_date: '2022-03-04'
|
|||
This document was moved to [another location](check.md#verify-database-values-can-be-decrypted-using-the-current-secrets).
|
||||
|
||||
<!-- This redirect file can be deleted after 2022-03-04. -->
|
||||
<!-- Before deletion, see: https://docs.gitlab.com/ee/development/documentation/#move-or-rename-a-page -->
|
||||
<!-- Redirects that point to other docs in the same project expire in three months. -->
|
||||
<!-- Redirects that point to docs in a different project or site (for example, link is not relative and starts with `https:`) expire in one year. -->
|
||||
<!-- Before deletion, see: https://docs.gitlab.com/ee/development/documentation/redirects.html -->
|
||||
|
|
|
|||
|
|
@ -6,4 +6,6 @@ remove_date: '2022-04-06'
|
|||
This document was moved to [another location](project_access_tokens.md).
|
||||
|
||||
<!-- This redirect file can be deleted after <2022-04-06>. -->
|
||||
<!-- Before deletion, see: https://docs.gitlab.com/ee/development/documentation/#move-or-rename-a-page -->
|
||||
<!-- Redirects that point to other docs in the same project expire in three months. -->
|
||||
<!-- Redirects that point to docs in a different project or site (for example, link is not relative and starts with `https:`) expire in one year. -->
|
||||
<!-- Before deletion, see: https://docs.gitlab.com/ee/development/documentation/redirects.html -->
|
||||
|
|
|
|||
|
|
@ -6,4 +6,6 @@ remove_date: '2023-01-31'
|
|||
This document was moved to [another location](https://gitlab.com/gitlab-org/gitlab-foss/-/blob/11-0-stable/doc/api/v3_to_v4.md).
|
||||
|
||||
<!-- This redirect file can be deleted after <2023-01-31>. -->
|
||||
<!-- Before deletion, see: https://docs.gitlab.com/ee/development/documentation/#move-or-rename-a-page -->
|
||||
<!-- Redirects that point to other docs in the same project expire in three months. -->
|
||||
<!-- Redirects that point to docs in a different project or site (for example, link is not relative and starts with `https:`) expire in one year. -->
|
||||
<!-- Before deletion, see: https://docs.gitlab.com/ee/development/documentation/redirects.html -->
|
||||
|
|
|
|||
|
|
@ -6,4 +6,6 @@ remove_date: '2022-04-27'
|
|||
This document was moved to [another location](merged_results_pipelines.md).
|
||||
|
||||
<!-- This redirect file can be deleted after 2022-04-27. -->
|
||||
<!-- Before deletion, see: https://docs.gitlab.com/ee/development/documentation/#move-or-rename-a-page -->
|
||||
<!-- Redirects that point to other docs in the same project expire in three months. -->
|
||||
<!-- Redirects that point to docs in a different project or site (for example, link is not relative and starts with `https:`) expire in one year. -->
|
||||
<!-- Before deletion, see: https://docs.gitlab.com/ee/development/documentation/redirects.html -->
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ Add a redirect to ensure:
|
|||
|
||||
- Users see the new page and can update or delete their bookmark.
|
||||
- External sites can update their links, especially sites that have automation that
|
||||
check for redirecting links.
|
||||
checks for redirected links.
|
||||
- The documentation site global navigation does not link to a missing page.
|
||||
|
||||
The links in the global navigation are already tested in the `gitlab-docs` project.
|
||||
|
|
@ -38,26 +38,28 @@ Technical Writers can help with any questions and can review your change.
|
|||
|
||||
There are two types of redirects:
|
||||
|
||||
- Redirect added into the documentation files themselves, for users who
|
||||
- [Redirect added into the documentation files themselves](#add-a-redirect), for users who
|
||||
view the docs in `/help` on self-managed instances. For example,
|
||||
[`/help` on GitLab.com](https://gitlab.com/help).
|
||||
- [GitLab Pages redirects](../../user/project/pages/redirects.md),
|
||||
for users who view the docs on [`docs.gitlab.com`](https://docs.gitlab.com).
|
||||
[`/help` on GitLab.com](https://gitlab.com/help). These must be added in the same
|
||||
MR that renames or moves a doc. Redirects to internal pages expire after three months
|
||||
and redirects to external pages (starting with `https:`) expire after a year.
|
||||
- [GitLab Pages redirects](../../user/project/pages/redirects.md), which are added
|
||||
automatically after redirect files expire. They must not be manually added by
|
||||
contributors and expire after nine months. Redirects pointing to external sites
|
||||
are not added to the GitLab Pages redirects.
|
||||
|
||||
The Technical Writing team manages the [process](https://gitlab.com/gitlab-org/technical-writing/-/blob/main/.gitlab/issue_templates/tw-monthly-tasks.md)
|
||||
to regularly update and [clean up the redirects](https://gitlab.com/gitlab-org/gitlab-docs/-/blob/main/doc/raketasks.md#clean-up-redirects).
|
||||
If you're a contributor, you may add a new redirect, but you don't need to delete
|
||||
the old ones. This process is automatic and handled by the Technical
|
||||
Writing team.
|
||||
Expired redirect files are removed from the documentation projects by the
|
||||
[`clean_redirects` Rake task](https://gitlab.com/gitlab-org/gitlab-docs/-/blob/main/doc/raketasks.md#clean-up-redirects),
|
||||
as part of the Technical Writing team's [monthly tasks](https://gitlab.com/gitlab-org/technical-writing/-/blob/main/.gitlab/issue_templates/tw-monthly-tasks.md).
|
||||
|
||||
## Add a redirect
|
||||
|
||||
NOTE:
|
||||
If the old page you're renaming doesn't exist in a stable branch, skip the
|
||||
following steps and ask a Technical Writer to add the redirect in
|
||||
[`redirects.yaml`](https://gitlab.com/gitlab-org/gitlab-docs/-/blob/main/content/_data/redirects.yaml).
|
||||
For example, if you add a new page on the 3rd of the month and then rename it before it gets
|
||||
added in the stable branch on the 18th, the old page will never be part of the internal `/help`.
|
||||
In that case, you can jump straight to the
|
||||
[Pages redirect](https://gitlab.com/gitlab-org/gitlab-docs/-/blob/main/doc/maintenance.md#pages-redirects).
|
||||
If the renamed page is new, you can sometimes skip the following steps and ask a
|
||||
Technical Writer to manually add the redirect to [`redirects.yaml`](https://gitlab.com/gitlab-org/gitlab-docs/-/blob/main/content/_data/redirects.yaml).
|
||||
For example, if you add a new page and then rename it before it's added to a release
|
||||
on the 18th. The old page is not in any version's `/help` section, so a technical writer
|
||||
can jump straight to the [Pages redirect](https://gitlab.com/gitlab-org/gitlab-docs/-/blob/main/doc/maintenance.md#pages-redirects).
|
||||
|
||||
To add a redirect:
|
||||
|
||||
|
|
@ -87,20 +89,13 @@ To add a redirect:
|
|||
bundle exec rake "gitlab:docs:redirect[doc/user/search/old_file.md, https://example.com]"
|
||||
```
|
||||
|
||||
Alternatively, you can omit the arguments and be asked to enter their values:
|
||||
- Alternatively, you can omit the arguments and be prompted to enter the values:
|
||||
|
||||
```shell
|
||||
bundle exec rake gitlab:docs:redirect
|
||||
```
|
||||
```shell
|
||||
bundle exec rake gitlab:docs:redirect
|
||||
```
|
||||
|
||||
If you don't want to use the Rake task, you can use the following template.
|
||||
|
||||
Replace the value of `redirect_to` with the new file path and `YYYY-MM-DD`
|
||||
with the date the file should be removed.
|
||||
|
||||
Redirect files that link to docs in internal documentation projects
|
||||
are removed after three months. Redirect files that link to external sites are
|
||||
removed after one year:
|
||||
If you don't want to use the Rake task, you can use the following template:
|
||||
|
||||
```markdown
|
||||
---
|
||||
|
|
@ -111,9 +106,14 @@ To add a redirect:
|
|||
This document was moved to [another location](../path/to/file/index.md).
|
||||
|
||||
<!-- This redirect file can be deleted after <YYYY-MM-DD>. -->
|
||||
<!-- Before deletion, see: https://docs.gitlab.com/ee/development/documentation/#move-or-rename-a-page -->
|
||||
<!-- Redirects that point to other docs in the same project expire in three months. -->
|
||||
<!-- Redirects that point to docs in a different project or site (for example, link is not relative and starts with `https:`) expire in one year. -->
|
||||
<!-- Before deletion, see: https://docs.gitlab.com/ee/development/documentation/redirects.html -->
|
||||
```
|
||||
|
||||
- Replace both instances of `../newpath/to/file/index.md` with the new file path.
|
||||
- Replace `YYYY-MM-DD` with the expiry date, as explained in the template.
|
||||
|
||||
1. If the documentation page being moved has any Disqus comments, follow the steps
|
||||
described in [Redirections for pages with Disqus comments](#redirections-for-pages-with-disqus-comments).
|
||||
1. Open a merge request with your changes. If a documentation page
|
||||
|
|
|
|||
|
|
@ -6,4 +6,6 @@ remove_date: '2022-04-13'
|
|||
This document was moved to [another location](gitlab_experiment.md).
|
||||
|
||||
<!-- This redirect file can be deleted after <2022-04-13>. -->
|
||||
<!-- Before deletion, see: https://docs.gitlab.com/ee/development/documentation/#move-or-rename-a-page -->
|
||||
<!-- Redirects that point to other docs in the same project expire in three months. -->
|
||||
<!-- Redirects that point to docs in a different project or site (for example, link is not relative and starts with `https:`) expire in one year. -->
|
||||
<!-- Before deletion, see: https://docs.gitlab.com/ee/development/documentation/redirects.html -->
|
||||
|
|
|
|||
|
|
@ -6,4 +6,6 @@ remove_date: '2022-03-01'
|
|||
This document was moved to [another location](https://about.gitlab.com/handbook/product-development-flow/feature-flag-lifecycle/).
|
||||
|
||||
<!-- This redirect file can be deleted after 2022-03-01. -->
|
||||
<!-- Before deletion, see: https://docs.gitlab.com/ee/development/documentation/#move-or-rename-a-page -->
|
||||
<!-- Redirects that point to other docs in the same project expire in three months. -->
|
||||
<!-- Redirects that point to docs in a different project or site (for example, link is not relative and starts with `https:`) expire in one year. -->
|
||||
<!-- Before deletion, see: https://docs.gitlab.com/ee/development/documentation/redirects.html -->
|
||||
|
|
|
|||
|
|
@ -6,4 +6,6 @@ remove_date: '2022-04-13'
|
|||
This document was moved to [another location](sidekiq/index.md).
|
||||
|
||||
<!-- This redirect file can be deleted after <2022-04-13>. -->
|
||||
<!-- Before deletion, see: https://docs.gitlab.com/ee/development/documentation/#move-or-rename-a-page -->
|
||||
<!-- Redirects that point to other docs in the same project expire in three months. -->
|
||||
<!-- Redirects that point to docs in a different project or site (for example, link is not relative and starts with `https:`) expire in one year. -->
|
||||
<!-- Before deletion, see: https://docs.gitlab.com/ee/development/documentation/redirects.html -->
|
||||
|
|
|
|||
|
|
@ -6,4 +6,6 @@ remove_date: '2022-03-08'
|
|||
This document was removed. For information about installing GitLab, see [this page](../index.md).
|
||||
|
||||
<!-- This redirect file can be deleted after <2022-03-08>. -->
|
||||
<!-- Before deletion, see: https://docs.gitlab.com/ee/development/documentation/#move-or-rename-a-page -->
|
||||
<!-- Redirects that point to other docs in the same project expire in three months. -->
|
||||
<!-- Redirects that point to docs in a different project or site (for example, link is not relative and starts with `https:`) expire in one year. -->
|
||||
<!-- Before deletion, see: https://docs.gitlab.com/ee/development/documentation/redirects.html -->
|
||||
|
|
|
|||
|
|
@ -6,4 +6,6 @@ remove_date: '2022-05-10'
|
|||
This document was moved to [another location](../user/project/repository/push_rules.md).
|
||||
|
||||
<!-- This redirect file can be deleted after <2022-05-10>. -->
|
||||
<!-- Before deletion, see: https://docs.gitlab.com/ee/development/documentation/#move-or-rename-a-page -->
|
||||
<!-- Redirects that point to other docs in the same project expire in three months. -->
|
||||
<!-- Redirects that point to docs in a different project or site (for example, link is not relative and starts with `https:`) expire in one year. -->
|
||||
<!-- Before deletion, see: https://docs.gitlab.com/ee/development/documentation/redirects.html -->
|
||||
|
|
|
|||
|
|
@ -6,8 +6,8 @@ info: To determine the technical writer assigned to the Stage/Group associated w
|
|||
|
||||
# Canary Deployments **(FREE)**
|
||||
|
||||
> - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/1659) in [GitLab Premium](https://about.gitlab.com/pricing/) 9.1.
|
||||
> - [Moved](https://gitlab.com/gitlab-org/gitlab/-/issues/212320) to GitLab Free in 13.8.
|
||||
> - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/1659) in GitLab 9.1.
|
||||
> - [Moved](https://gitlab.com/gitlab-org/gitlab/-/issues/212320) from GitLab Premium to GitLab Free in 13.8.
|
||||
|
||||
A popular [Continuous Deployment](https://en.wikipedia.org/wiki/Continuous_deployment)
|
||||
strategy, where a small portion of the fleet is updated to the new version of
|
||||
|
|
@ -71,8 +71,8 @@ can quickly notice them.
|
|||
|
||||
### Advanced traffic control with Canary Ingress (DEPRECATED)
|
||||
|
||||
> - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/215501) in [GitLab Premium](https://about.gitlab.com/pricing/) 13.6.
|
||||
> - [Moved](https://gitlab.com/gitlab-org/gitlab/-/issues/212320) to Free in GitLab 13.8.
|
||||
> - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/215501) in GitLab 13.6.
|
||||
> - [Moved](https://gitlab.com/gitlab-org/gitlab/-/issues/212320) from GitLab Premium to GitLab Free in 13.8.
|
||||
> - [Deprecated](https://gitlab.com/groups/gitlab-org/configure/-/epics/8) in GitLab 14.5.
|
||||
|
||||
WARNING:
|
||||
|
|
|
|||
|
|
@ -6,4 +6,6 @@ remove_date: '2022-02-24'
|
|||
This file was moved to [another location](index.md).
|
||||
|
||||
<!-- This redirect file can be deleted after <2022-02-24>. -->
|
||||
<!-- Before deletion, see: https://docs.gitlab.com/ee/development/documentation/#move-or-rename-a-page -->
|
||||
<!-- Redirects that point to other docs in the same project expire in three months. -->
|
||||
<!-- Redirects that point to docs in a different project or site (for example, link is not relative and starts with `https:`) expire in one year. -->
|
||||
<!-- Before deletion, see: https://docs.gitlab.com/ee/development/documentation/redirects.html -->
|
||||
|
|
|
|||
|
|
@ -6,4 +6,6 @@ remove_date: '2022-03-14'
|
|||
This file was moved to [another location](custom_domains_ssl_tls_certification/lets_encrypt_integration.md).
|
||||
|
||||
<!-- This redirect file can be deleted after <2022-03-14>. -->
|
||||
<!-- Before deletion, see: https://docs.gitlab.com/ee/development/documentation/#move-or-rename-a-page -->
|
||||
<!-- Redirects that point to other docs in the same project expire in three months. -->
|
||||
<!-- Redirects that point to docs in a different project or site (for example, link is not relative and starts with `https:`) expire in one year. -->
|
||||
<!-- Before deletion, see: https://docs.gitlab.com/ee/development/documentation/redirects.html -->
|
||||
|
|
|
|||
|
|
@ -54,7 +54,9 @@ namespace :gitlab do
|
|||
post.puts "This document was moved to [another location](#{new_path})."
|
||||
post.puts
|
||||
post.puts "<!-- This redirect file can be deleted after <#{date}>. -->"
|
||||
post.puts "<!-- Before deletion, see: https://docs.gitlab.com/ee/development/documentation/#move-or-rename-a-page -->"
|
||||
post.puts "<!-- Redirects that point to other docs in the same project expire in three months. -->"
|
||||
post.puts "<!-- Redirects that point to docs in a different project or site (link is not relative and starts with `https:`) expire in one year. -->"
|
||||
post.puts "<!-- Before deletion, see: https://docs.gitlab.com/ee/development/documentation/redirects.html -->"
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
6
qa/qa.rb
6
qa/qa.rb
|
|
@ -11,6 +11,12 @@ require_relative 'lib/gitlab'
|
|||
require_relative '../config/bundler_setup'
|
||||
Bundler.require(:default)
|
||||
|
||||
require 'securerandom'
|
||||
require 'pathname'
|
||||
require 'active_support/core_ext/hash'
|
||||
require 'active_support/core_ext/object/blank'
|
||||
require 'rainbow/refinement'
|
||||
|
||||
module QA
|
||||
root = "#{__dir__}/qa"
|
||||
|
||||
|
|
|
|||
|
|
@ -2,13 +2,19 @@
|
|||
|
||||
require 'logger'
|
||||
require 'forwardable'
|
||||
require 'rainbow/refinement'
|
||||
|
||||
module QA
|
||||
module Runtime
|
||||
module Logger
|
||||
extend SingleForwardable
|
||||
using Rainbow
|
||||
|
||||
LEVEL_COLORS = {
|
||||
"DEBUG" => :magenta,
|
||||
"INFO" => :green,
|
||||
"WARN" => :yellow,
|
||||
"ERROR" => :indianred,
|
||||
"FATAL" => :red
|
||||
}.freeze
|
||||
|
||||
def_delegators :logger, :debug, :info, :warn, :error, :fatal, :unknown
|
||||
|
||||
|
|
@ -23,8 +29,9 @@ module QA
|
|||
|
||||
logger.formatter = proc do |severity, datetime, progname, msg|
|
||||
date_format = datetime.strftime("%Y-%m-%d %H:%M:%S")
|
||||
msg_prefix = "[date=#{date_format} from=QA Tests] #{severity.ljust(5)} -- "
|
||||
|
||||
"[date=#{date_format} from=QA Tests] #{severity.ljust(5)} -- ".yellow + "#{msg}\n"
|
||||
Rainbow(msg_prefix).send(LEVEL_COLORS.fetch(severity, :yellow)) + "#{msg}\n"
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
require 'active_support/inflector'
|
||||
require 'rainbow/refinement'
|
||||
|
||||
module QA
|
||||
module Support
|
||||
|
|
@ -40,7 +39,9 @@ module QA
|
|||
QA::Runtime::Logger.debug(msg.join(' '))
|
||||
end
|
||||
|
||||
QA::Runtime::Logger.debug("Attempt number #{attempts + 1}".bg(:yellow).black) if log && max_attempts && attempts > 0
|
||||
if log && max_attempts && attempts > 0
|
||||
QA::Runtime::Logger.debug("Attempt number #{attempts + 1}".bg(:yellow).black)
|
||||
end
|
||||
|
||||
result = yield
|
||||
if result
|
||||
|
|
|
|||
|
|
@ -2,12 +2,6 @@
|
|||
|
||||
require_relative '../qa'
|
||||
|
||||
require 'securerandom'
|
||||
require 'pathname'
|
||||
require 'active_support/core_ext/hash'
|
||||
require 'active_support/core_ext/object/blank'
|
||||
require 'rainbow/refinement'
|
||||
|
||||
require_relative 'qa_deprecation_toolkit_env'
|
||||
QaDeprecationToolkitEnv.configure!
|
||||
|
||||
|
|
@ -36,7 +30,7 @@ RSpec.configure do |config|
|
|||
end
|
||||
|
||||
config.prepend_before do |example|
|
||||
QA::Runtime::Logger.debug("\nStarting test: #{example.full_description}\n")
|
||||
QA::Runtime::Logger.info("Starting test: #{Rainbow(example.full_description).bright}")
|
||||
QA::Runtime::Example.current = example
|
||||
|
||||
# Reset fabrication counters tracked in resource base
|
||||
|
|
|
|||
|
|
@ -420,6 +420,14 @@ RSpec.describe 'GFM autocomplete', :js do
|
|||
end
|
||||
end
|
||||
end
|
||||
|
||||
context 'when typing enter for autocomplete in a markdown list' do
|
||||
it 'does not create a new list item' do
|
||||
fill_in 'Comment', with: "- @#{user.username}\n"
|
||||
|
||||
expect(find_field('Comment').value).to eq "- @#{user.username}\n"
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
private
|
||||
|
|
|
|||
|
|
@ -32,6 +32,22 @@ describe('jobs/components/table/graphql/cache_config', () => {
|
|||
CIJobConnectionIncomingCache.nodes.length + CIJobConnectionExistingCache.nodes.length,
|
||||
);
|
||||
});
|
||||
|
||||
it('should contain the pageInfo key as part of the result', () => {
|
||||
const res = cacheConfig.typePolicies.CiJobConnection.merge({}, CIJobConnectionIncomingCache, {
|
||||
args: firstLoadArgs,
|
||||
});
|
||||
|
||||
expect(res.pageInfo).toEqual(
|
||||
expect.objectContaining({
|
||||
__typename: 'PageInfo',
|
||||
endCursor: 'eyJpZCI6IjIwNTEifQ',
|
||||
hasNextPage: true,
|
||||
hasPreviousPage: false,
|
||||
startCursor: 'eyJpZCI6IjIxNzMifQ',
|
||||
}),
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
describe('when fetching data with different statuses', () => {
|
||||
|
|
|
|||
|
|
@ -1,4 +1,6 @@
|
|||
import $ from 'jquery';
|
||||
import { insertMarkdownText, keypressNoteText } from '~/lib/utils/text_markdown';
|
||||
import '~/lib/utils/jquery_at_who';
|
||||
|
||||
describe('init markdown', () => {
|
||||
let textArea;
|
||||
|
|
@ -223,6 +225,24 @@ describe('init markdown', () => {
|
|||
expect(textArea.selectionEnd).toBe(text.length);
|
||||
});
|
||||
|
||||
// test that when we're in the middle of autocomplete, we don't
|
||||
// add a new list item
|
||||
it.each`
|
||||
text | expected | atwho_selecting
|
||||
${'- item @'} | ${'- item @'} | ${true}
|
||||
${'- item @'} | ${'- item @\n- '} | ${false}
|
||||
`('behaves correctly during autocomplete', ({ text, expected, atwho_selecting }) => {
|
||||
jest.spyOn($.fn, 'atwho').mockReturnValue(atwho_selecting);
|
||||
|
||||
textArea.value = text;
|
||||
textArea.setSelectionRange(text.length, text.length);
|
||||
|
||||
textArea.addEventListener('keydown', keypressNoteText);
|
||||
textArea.dispatchEvent(enterEvent);
|
||||
|
||||
expect(textArea.value).toEqual(expected);
|
||||
});
|
||||
|
||||
it('does nothing if feature flag disabled', () => {
|
||||
gon.features = { markdownContinueLists: false };
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue