Skip to content

Commit

Permalink
add simple tests for getting started sections
Browse files Browse the repository at this point in the history
  • Loading branch information
Sloane Perrault committed Jul 7, 2023
1 parent 7c9b33d commit 56c6e82
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,41 @@ describe('<Overview />', () => {
expect(wrapper).toBeDefined();
});

test.todo('getting started');
test.todo('select client');
test.todo('install client');
test.todo('api key');
test.todo('configure client');
test.todo('test connection');
test.todo('ingest data');
test.todo('build query');
test.todo("what's next?");
test('getting started', () => {
const { getByRole } = render(<Overview />);
expect(getByRole('heading', { name: 'Get started with Elasticsearch' })).toBeDefined();
});

test('select client', () => {
const { getByRole } = render(<Overview />);
expect(getByRole('heading', { name: 'Select your client' })).toBeDefined();
});
test('install client', () => {
const { getByRole } = render(<Overview />);
expect(getByRole('heading', { name: 'Install a client' })).toBeDefined();
});
test('api key', () => {
const { getByRole } = render(<Overview />);
expect(getByRole('heading', { name: 'Store your API key and Cloud ID' })).toBeDefined();
});
test('configure client', () => {
const { getByRole } = render(<Overview />);
expect(getByRole('heading', { name: 'Configure your client' })).toBeDefined();
});
test('test connection', () => {
const { getByRole } = render(<Overview />);
expect(getByRole('heading', { name: 'Test your connection' })).toBeDefined();
});
test('ingest data', () => {
const { getByRole } = render(<Overview />);
expect(getByRole('heading', { name: 'Ingest data' })).toBeDefined();
});
test('build query', () => {
const { getByRole } = render(<Overview />);
expect(getByRole('heading', { name: 'Build your first search query' })).toBeDefined();
});
test("what's next?", () => {
const { getByRole } = render(<Overview />);
expect(getByRole('heading', { name: "What's next?" })).toBeDefined();
});
});
3 changes: 1 addition & 2 deletions x-pack/plugins/serverless_search/public/test/test_utils.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,9 @@ import { coreMock } from '@kbn/core/public/mocks';
import { cloudMock } from '@kbn/cloud-plugin/public/mocks';
import { sharePluginMock } from '@kbn/share-plugin/public/mocks';
import { userProfileMock } from '@kbn/security-plugin/common/model/user_profile.mock';
import type { ServerlessSearchContext } from '../application/hooks/use_kibana';

export const core = coreMock.createStart();
export const services: ServerlessSearchContext = {
export const services = {
cloud: cloudMock.createStart(),
share: sharePluginMock.createStartContract(),
userProfile: userProfileMock.createWithSecurity(),
Expand Down

0 comments on commit 56c6e82

Please sign in to comment.