-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'upstream/main' into 188514-rules-4xx-oas
- Loading branch information
Showing
267 changed files
with
6,357 additions
and
3,574 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Validating CODEOWNERS rules …
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
name: CodeQL statistics | ||
|
||
on: | ||
schedule: | ||
- cron: '27 0 * * 1' # At 00:27 every Monday | ||
|
||
jobs: | ||
stats: | ||
name: CodeQL statistics | ||
runs-on: ubuntu-latest | ||
if: github.repository == 'elastic/kibana' # Hack: Do not run on forks | ||
steps: | ||
- name: Checkout kibana-operations | ||
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 | ||
with: | ||
repository: 'elastic/kibana-operations' | ||
ref: main | ||
path: ./kibana-operations | ||
token: ${{secrets.KIBANAMACHINE_TOKEN}} | ||
|
||
- name: CodeQL alert statistics | ||
working-directory: ./kibana-operations/triage | ||
env: | ||
GITHUB_TOKEN: ${{secrets.KIBANAMACHINE_TOKEN}} | ||
SLACK_TOKEN: ${{secrets.CODE_SCANNING_SLACK_TOKEN}} | ||
run: | | ||
npm ci --omit=dev | ||
node codeql-alert-stats |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
95 changes: 95 additions & 0 deletions
95
packages/kbn-language-documentation-popover/src/components/as_flyout/index.test.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the "Elastic License | ||
* 2.0", the "GNU Affero General Public License v3.0 only", and the "Server Side | ||
* Public License v 1"; you may not use this file except in compliance with, at | ||
* your election, the "Elastic License 2.0", the "GNU Affero General Public | ||
* License v3.0 only", or the "Server Side Public License, v 1". | ||
*/ | ||
|
||
import React from 'react'; | ||
import { screen, render, fireEvent, waitFor } from '@testing-library/react'; | ||
import { LanguageDocumentationFlyout } from '.'; | ||
|
||
jest.mock('../../sections', () => { | ||
const module = jest.requireActual('../../sections'); | ||
return { | ||
...module, | ||
getESQLDocsSections: () => ({ | ||
groups: [ | ||
{ | ||
label: 'Section one', | ||
description: 'Section 1 description', | ||
items: [], | ||
}, | ||
{ | ||
label: 'Section two', | ||
items: [ | ||
{ | ||
label: 'Section two item 1', | ||
description: 'Section two item 1 description', | ||
}, | ||
{ | ||
label: 'Section two item 2', | ||
description: 'Section two item 2 description', | ||
}, | ||
], | ||
}, | ||
{ | ||
label: 'Section three', | ||
items: [ | ||
{ | ||
label: 'Section three item 1', | ||
description: 'Section three item 1 description', | ||
}, | ||
{ | ||
label: 'Section three item 2', | ||
description: 'Section three item 2 description', | ||
}, | ||
], | ||
}, | ||
], | ||
initialSection: <span>Here is the initial section</span>, | ||
}), | ||
}; | ||
}); | ||
|
||
describe('###Documentation flyout component', () => { | ||
const renderFlyout = (linkToDocumentation?: string) => { | ||
return render( | ||
<LanguageDocumentationFlyout | ||
isHelpMenuOpen={true} | ||
onHelpMenuVisibilityChange={jest.fn()} | ||
linkToDocumentation={linkToDocumentation} | ||
/> | ||
); | ||
}; | ||
it('has a header element for navigation through the sections', () => { | ||
renderFlyout(); | ||
expect(screen.getByTestId('language-documentation-navigation-search')).toBeInTheDocument(); | ||
expect(screen.getByTestId('language-documentation-navigation-dropdown')).toBeInTheDocument(); | ||
expect(screen.queryByTestId('language-documentation-navigation-link')).not.toBeInTheDocument(); | ||
}); | ||
|
||
it('has a link if linkToDocumentation prop is given', () => { | ||
renderFlyout('meow'); | ||
expect(screen.getByTestId('language-documentation-navigation-link')).toBeInTheDocument(); | ||
}); | ||
|
||
it('contains the two last sections', async () => { | ||
renderFlyout(); | ||
await waitFor(() => { | ||
expect(screen.getByText('Section two')).toBeInTheDocument(); | ||
expect(screen.getByText('Section three')).toBeInTheDocument(); | ||
}); | ||
}); | ||
|
||
it('contains the correct section if user updates the search input', async () => { | ||
renderFlyout(); | ||
const input = screen.getByTestId('language-documentation-navigation-search'); | ||
fireEvent.change(input, { target: { value: 'two' } }); | ||
await waitFor(() => { | ||
expect(screen.getByText('Section two')).toBeInTheDocument(); | ||
}); | ||
}); | ||
}); |
Oops, something went wrong.