Skip to content

Commit

Permalink
N21-1918 fixes test
Browse files Browse the repository at this point in the history
  • Loading branch information
arnegns committed Jul 24, 2024
1 parent 75ff3c5 commit 80c1631
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 2 deletions.
1 change: 1 addition & 0 deletions apps/server/src/modules/tool/external-tool/entity/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ export * from './external-tool.entity';
export * from './config';
export * from './custom-parameter';
export { ExternalToolMediumEntity } from './external-tool-medium.entity';
export { FileRecordRefEmbeddable } from './file-record-ref.embeddable';
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export class ExternalToolService {
}

public async updateExternalTool(toUpdate: ExternalTool): Promise<ExternalTool> {
// TODO use encryption for secret
// TODO N21-2097 use encryption for secret
await this.updateOauth2ToolConfig(toUpdate);

const externalTool: ExternalTool = await this.externalToolRepo.save(toUpdate);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ export class Lti11ToolLaunchStrategy extends AbstractLaunchStrategy {

const additionalProperties: PropertyData[] = [
new PropertyData({ name: 'key', value: config.key }),
// TODO use decryption for secret
// TODO N21-2097 use decryption for secret
new PropertyData({ name: 'secret', value: config.secret }),

new PropertyData({ name: 'lti_message_type', value: config.lti_message_type, location: PropertyLocation.BODY }),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,7 @@ describe(ExternalToolRepo.name, () => {
const ltiToolC: ExternalToolEntity = externalToolEntityFactory.withName('B').buildWithId();
const ltiTools: ExternalToolEntity[] = [ltiToolA, ltiToolB, ltiToolC];
await em.persistAndFlush([ltiToolA, ltiToolB, ltiToolC]);
em.clear();

return { queryExternalToolDO, options, ltiTools };
};
Expand Down Expand Up @@ -281,6 +282,14 @@ describe(ExternalToolRepo.name, () => {
});

describe('when query is given', () => {
it('should populate thumbnail', async () => {
const { queryExternalToolDO, options } = await setupFind();

const page: Page<ExternalTool> = await repo.find(queryExternalToolDO, options);

expect(page.data[0].thumbnail?.fileName).toBeDefined();
});

describe('by ids', () => {
it('should return external tools for given ids', async () => {
const { options, ltiTools } = await setupFind();
Expand Down

0 comments on commit 80c1631

Please sign in to comment.