1
0

101654: Fixed relationship fields not being hidden when they are out of scope

This commit is contained in:
Alexandre Vryghem
2023-05-12 17:18:44 +02:00
parent a6a10200d2
commit b318d7281a
2 changed files with 42 additions and 3 deletions

View File

@@ -347,6 +347,22 @@ describe('SubmissionSectionFormComponent test suite', () => {
} as FormFieldModel
]
},
{
fields: [
{
selectableMetadata: [{ metadata: 'scoped.workflow.relation' }],
scope: 'WORKFLOW',
} as FormFieldModel,
],
},
{
fields: [
{
selectableMetadata: [{ metadata: 'scoped.workspace.relation' }],
scope: 'WORKSPACE',
} as FormFieldModel,
],
},
{
fields: [
{
@@ -375,6 +391,14 @@ describe('SubmissionSectionFormComponent test suite', () => {
it('should return false for fields scoped to workflow', () => {
expect((comp as any).inCurrentSubmissionScope('scoped.workflow')).toBe(false);
});
it('should return true for relation fields scoped to workspace', () => {
expect((comp as any).inCurrentSubmissionScope('scoped.workspace.relation')).toBe(true);
});
it('should return false for relation fields scoped to workflow', () => {
expect((comp as any).inCurrentSubmissionScope('scoped.workflow.relation')).toBe(false);
});
});
describe('in workflow scope', () => {
@@ -394,6 +418,14 @@ describe('SubmissionSectionFormComponent test suite', () => {
it('should return false for fields scoped to workspace', () => {
expect((comp as any).inCurrentSubmissionScope('scoped.workspace')).toBe(false);
});
it('should return true for relation fields scoped to workflow', () => {
expect((comp as any).inCurrentSubmissionScope('scoped.workflow.relation')).toBe(true);
});
it('should return false for relation fields scoped to workspace', () => {
expect((comp as any).inCurrentSubmissionScope('scoped.workspace.relation')).toBe(false);
});
});
});