Skip to content

Commit

Permalink
Fixed UI Tests
Browse files Browse the repository at this point in the history
  • Loading branch information
rmathis committed Sep 30, 2022
1 parent b2ba018 commit 77ee749
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 6 deletions.
4 changes: 2 additions & 2 deletions ui/src/app/metadata/domain/index.test.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { NameIDFilterEditor } from './filter/definition/NameIdFilterDefinition';
import { getDefinition } from './index';
import { FileSystemMetadataProviderEditor } from './provider/definition/FileSystemMetadataProviderDefinition';
import { SourceEditor } from './source/definition/SourceDefinition';
import { OidcSourceEditor } from './source/definition/OidcSourceDefinition';

jest.mock('../../App.constant', () => ({
get API_BASE_PATH() {
Expand All @@ -11,7 +11,7 @@ jest.mock('../../App.constant', () => ({

describe('getDefinitions method', () => {
it('should retrieve the definition', () => {
expect(getDefinition('source')).toBe(SourceEditor);
expect(getDefinition('OIDC')).toBe(OidcSourceEditor);
expect(getDefinition('NameIDFormat')).toBe(NameIDFilterEditor);
expect(getDefinition('FilesystemMetadataResolver')).toBe(FileSystemMetadataProviderEditor);
});
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { SourceBase } from './SourceDefinition';
jest.mock('../../metadata/hoc/MetadataSchema');

jest.mock('../../../../App.constant', () => ({
get API_BASE_PATH() {
Expand Down
2 changes: 2 additions & 0 deletions ui/src/app/metadata/hooks/schema.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ jest.mock('../../App.constant', () => ({
}
}));

jest.mock('../../metadata/hoc/MetadataSchema');

describe('useUiSchema', () => {
let realUseMemo;
let useMemoMock;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import Translate from '../../i18n/components/translate';
import { InfoIcon } from '../../form/component/InfoIcon';
import { useTranslator } from '../../i18n/hooks';
import { useMetadataSources } from '../hooks/api';
import Button from 'react-bootstrap/esm/Button';
import Button from 'react-bootstrap/Button';

export function MetadataSourceProtocolSelector({ types = [], loading, children}) {

Expand Down
16 changes: 13 additions & 3 deletions ui/src/testing/uiSchema.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ const schema = {
{
"size": 6,
"fields": [
"protocol",
"serviceProviderName",
"entityId",
"organization"
Expand All @@ -27,7 +28,7 @@ const schema = {
]
},
{
"size": 6,
"size": 12,
"fields": [
"serviceProviderSsoDescriptor"
]
Expand Down Expand Up @@ -135,7 +136,7 @@ const schema = {
"fields": [
"authenticationRequestsSigned",
"wantAssertionsSigned",
"x509Certificates"
"keyDescriptors"
]
}
]
Expand All @@ -152,11 +153,17 @@ const schema = {
"inline": true
}
},
"x509Certificates": {
"keyDescriptors": {
"type": "certificate",
"ui:options": {
"orderable": false
},
"ui:order": [
"name",
"elementType",
"type",
"value",
],
"items": {
"type": {
"ui:widget": "radio",
Expand Down Expand Up @@ -208,6 +215,9 @@ const schema = {
"serviceProviderName": {},
"entityId": {},
"organization": {},
"protocol": {
"ui:readonly": true,
},
"ui:disabled": false
};

Expand Down

0 comments on commit 77ee749

Please sign in to comment.