-
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.
initial test plan for trusted app create form
- Loading branch information
1 parent
cd8efb5
commit e11874b
Showing
1 changed file
with
77 additions
and
0 deletions.
There are no files selected for viewing
77 changes: 77 additions & 0 deletions
77
...ion/public/management/pages/trusted_apps/view/components/create_trusted_app_form.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,77 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License; | ||
* you may not use this file except in compliance with the Elastic License. | ||
*/ | ||
|
||
import { | ||
AppContextTestRender, | ||
createAppRootMockRenderer, | ||
} from '../../../../../common/mock/endpoint'; | ||
import * as reactTestingLibrary from '@testing-library/react'; | ||
import React from 'react'; | ||
import { CreateTrustedAppForm, CreateTrustedAppFormProps } from './create_trusted_app_form'; | ||
|
||
describe('When showing the Trusted App Create Form', () => { | ||
let render: () => ReturnType<AppContextTestRender['render']>; | ||
let onChangeCallback: jest.MockedFunction<CreateTrustedAppFormProps['onChange']>; | ||
|
||
beforeEach(() => { | ||
const mockedContext = createAppRootMockRenderer(); | ||
|
||
onChangeCallback = jest.fn(); | ||
render = () => mockedContext.render(<CreateTrustedAppForm onChange={onChangeCallback} />); | ||
}); | ||
|
||
it.todo('should show Name as required'); | ||
|
||
it.todo('should default OS to Windows'); | ||
|
||
it.todo('should allow user to select between 3 OSs'); | ||
|
||
it.todo('should show Description as optional'); | ||
|
||
it.todo('should NOT initially show any inline validation errors'); | ||
|
||
it.todo('should show top-level Errors'); | ||
|
||
describe('the condition builder component', () => { | ||
it.todo('should show an initial condition entry'); | ||
|
||
it.todo('should not allow the entry to be removed if its the only one displayed'); | ||
|
||
it.todo('should display 2 options for Field'); | ||
|
||
it.todo('should show the value field as required'); | ||
|
||
it.todo('should display the `AND` button'); | ||
|
||
it.todo('should add a new condition entry when `AND` is clicked'); | ||
|
||
it.todo('should have remove icons enabled when multiple conditions are present'); | ||
}); | ||
|
||
describe('and the user visits required fields but does not fill them out', () => { | ||
it.todo('should show Name validation error'); | ||
|
||
it.todo('should show Condition validation error'); | ||
|
||
it.todo('should NOT display any other errors'); | ||
|
||
it.todo('should call change callback with isValid set to false and contain the new item'); | ||
}); | ||
|
||
describe('and invalid data is entered', () => { | ||
it.todo('should validate that Name has a non empty space value'); | ||
|
||
it.todo('should validate that a condition value has a non empty space value'); | ||
|
||
it.todo( | ||
'should validate all condition values (when multiples exist) have non empty space value' | ||
); | ||
}); | ||
|
||
describe('and all required data passes validation', () => { | ||
it.todo('should call change callback with isValid set to true and contain the new item'); | ||
}); | ||
}); |