Skip to content

Commit

Permalink
N21-1494 move toolConfiguration status
Browse files Browse the repository at this point in the history
  • Loading branch information
mrikallab committed Nov 23, 2023
1 parent 1021f15 commit 6659d21
Show file tree
Hide file tree
Showing 5 changed files with 46 additions and 8 deletions.
2 changes: 1 addition & 1 deletion apps/server/src/modules/tool/common/domain/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
export * from './custom-parameter.do';
export * from './custom-parameter-entry.do';
export * from '../enum/tool-configuration-status';
export * from './tool-configuration-status';
2 changes: 1 addition & 1 deletion apps/server/src/modules/tool/common/enum/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ export * from './tool-context-type.enum';
export * from './custom-parameter-location.enum';
export * from './custom-parameter-scope.enum';
export * from './custom-parameter-type.enum';
export * from './tool-configuration-status';
export * from '../domain/tool-configuration-status';
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,15 @@ describe('ToolReferenceService', () => {
contextExternalToolService.findById.mockResolvedValueOnce(contextExternalTool);
schoolExternalToolService.findById.mockResolvedValueOnce(schoolExternalTool);
externalToolService.findById.mockResolvedValueOnce(externalTool);
toolVersionService.determineToolConfigurationStatus.mockResolvedValue(ToolConfigurationStatus.OUTDATED);
toolVersionService.determineToolConfigurationStatus.mockResolvedValue(
new ToolConfigurationStatus({
latest: false,
isDisabled: false,
isOutdatedOnScopeSchool: true,
isOutdatedOnScopeContext: false,
isUnkown: false,
})
);
externalToolLogoService.buildLogoUrl.mockReturnValue(logoUrl);

return {
Expand Down Expand Up @@ -123,7 +131,13 @@ describe('ToolReferenceService', () => {
logoUrl,
displayName: contextExternalTool.displayName as string,
openInNewTab: externalTool.openNewTab,
status: ToolConfigurationStatus.OUTDATED,
status: new ToolConfigurationStatus({
latest: false,
isDisabled: false,
isOutdatedOnScopeSchool: true,
isOutdatedOnScopeContext: false,
isUnkown: false,
}),
contextToolId: contextExternalToolId,
});
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,13 @@ describe('ToolSchoolController (API)', () => {
name: externalToolEntity.name,
schoolId: postParams.schoolId,
toolId: postParams.toolId,
status: ToolConfigurationStatusResponse.LATEST,
status: new ToolConfigurationStatusResponse({
latest: true,
isDisabled: false,
isOutdatedOnScopeSchool: false,
isOutdatedOnScopeContext: false,
isUnkown: false,
}),
toolVersion: postParams.version,
parameters: [
{ name: 'param1', value: 'value' },
Expand Down Expand Up @@ -297,7 +303,13 @@ describe('ToolSchoolController (API)', () => {
name: externalToolEntity.name,
schoolId: school.id,
toolId: externalToolEntity.id,
status: ToolConfigurationStatusResponse.OUTDATED,
status: new ToolConfigurationStatusResponse({
latest: false,
isDisabled: false,
isOutdatedOnScopeSchool: true,
isOutdatedOnScopeContext: false,
isUnkown: false,
}),
toolVersion: schoolExternalToolEntity.toolVersion,
parameters: [
{
Expand Down Expand Up @@ -340,7 +352,13 @@ describe('ToolSchoolController (API)', () => {
name: '',
schoolId: school.id,
toolId: externalToolEntity.id,
status: ToolConfigurationStatusResponse.UNKNOWN,
status: new ToolConfigurationStatusResponse({
latest: false,
isDisabled: false,
isOutdatedOnScopeSchool: false,
isOutdatedOnScopeContext: false,
isUnkown: true,
}),
toolVersion: schoolExternalToolEntity.toolVersion,
parameters: [
{
Expand Down Expand Up @@ -466,7 +484,13 @@ describe('ToolSchoolController (API)', () => {
name: externalToolEntity.name,
schoolId: postParamsUpdate.schoolId,
toolId: postParamsUpdate.toolId,
status: ToolConfigurationStatusResponse.LATEST,
status: new ToolConfigurationStatusResponse({
latest: true,
isDisabled: false,
isOutdatedOnScopeSchool: false,
isOutdatedOnScopeContext: false,
isUnkown: false,
}),
toolVersion: postParamsUpdate.version,
parameters: [
{
Expand Down

0 comments on commit 6659d21

Please sign in to comment.