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
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2023-06-29 18:08:00 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2023-06-29 18:08:00 +0300
commit4d3677a52dab1bb5c707ad493dcab8c8bca3dd8b (patch)
tree5eb579a2e73050aade69edd5bf18ba3b29c86780 /spec/frontend/search
parent37b681b2477113b5008efb79356261e89c4ff82f (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/frontend/search')
-rw-r--r--spec/frontend/search/sidebar/components/label_filter_spec.js30
1 files changed, 30 insertions, 0 deletions
diff --git a/spec/frontend/search/sidebar/components/label_filter_spec.js b/spec/frontend/search/sidebar/components/label_filter_spec.js
index c5df374d4ef..2a5b3a96045 100644
--- a/spec/frontend/search/sidebar/components/label_filter_spec.js
+++ b/spec/frontend/search/sidebar/components/label_filter_spec.js
@@ -92,6 +92,7 @@ describe('GlobalSearchSidebarLabelFilter', () => {
const findCheckboxFilter = () => wrapper.findAllComponents(LabelDropdownItems);
const findAlert = () => wrapper.findComponent(GlAlert);
const findLoadingIcon = () => wrapper.findComponent(GlLoadingIcon);
+ const findNoLabelsFoundMessage = () => wrapper.findComponentByTestId('no-labels-found-message');
describe('Renders correctly closed', () => {
beforeEach(async () => {
@@ -228,6 +229,33 @@ describe('GlobalSearchSidebarLabelFilter', () => {
});
});
+ describe('Renders no-labels state correctly', () => {
+ beforeEach(async () => {
+ createComponent();
+ store.commit(REQUEST_AGGREGATIONS);
+ await Vue.nextTick();
+
+ findSearchBox().vm.$emit('focusin');
+ findSearchBox().vm.$emit('input', 'ssssssss');
+ });
+
+ it('renders checkbox filter', () => {
+ expect(findCheckboxFilter().exists()).toBe(false);
+ });
+
+ it("doesn't render alert", () => {
+ expect(findAlert().exists()).toBe(false);
+ });
+
+ it("doesn't render items", () => {
+ expect(findAllSelectedLabelsAbove().exists()).toBe(false);
+ });
+
+ it('renders no labels found text', () => {
+ expect(findNoLabelsFoundMessage().exists()).toBe(true);
+ });
+ });
+
describe('Renders error state correctly', () => {
beforeEach(async () => {
createComponent();
@@ -294,6 +322,8 @@ describe('GlobalSearchSidebarLabelFilter', () => {
describe('dropdown checkboxes work', () => {
beforeEach(async () => {
createComponent();
+ store.commit(RECEIVE_AGGREGATIONS_SUCCESS, MOCK_LABEL_AGGREGATIONS.data);
+ await Vue.nextTick();
await findSearchBox().vm.$emit('focusin');
await Vue.nextTick();