Skip to content

Commit

Permalink
N21-1269 adds missing test
Browse files Browse the repository at this point in the history
  • Loading branch information
arnegns committed Sep 19, 2023
1 parent 0d80aff commit 72024ef
Showing 1 changed file with 26 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { createMock, DeepMocked } from '@golevelup/ts-jest';
import { Configuration } from '@hpi-schul-cloud/commons/lib';
import { InternalServerErrorException, NotFoundException } from '@nestjs/common';
import { Test, TestingModule } from '@nestjs/testing';
import { IFindOptions, LtiToolDO, Page, Pseudonym, UserDO } from '@shared/domain';
Expand Down Expand Up @@ -503,4 +504,29 @@ describe('PseudonymService', () => {
});
});
});

describe('getIframeSubject', () => {
describe('when pseudonym is given', () => {
const setup = () => {
const pseudonym = 'pseudonym';
const host = 'https://host.de';
Configuration.set('HOST', host);

return {
pseudonym,
host,
};
};

it('should return the iframeSubject', () => {
const { pseudonym, host } = setup();

const result: string = service.getIframeSubject(pseudonym);

expect(result).toEqual(
`<iframe src="${host}/oauth2/username/${pseudonym}" title="username" style="height: 26px; width: 180px; border: none;"></iframe>`
);
});
});
});
});

0 comments on commit 72024ef

Please sign in to comment.