Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor/decouple runtime tests #29

Merged
merged 61 commits into from
Mar 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
61 commits
Select commit Hold shift + click to select a range
9f0e01c
refactor: decouple iqlQuery tests
Magnus-Kuhn Feb 19, 2024
bd69c42
Merge branch 'main' into refactor/decouple-runtime-tests
mergify[bot] Feb 19, 2024
5f786f7
Merge branch 'main' into refactor/decouple-runtime-tests
mergify[bot] Feb 19, 2024
56e1fbc
refactor: remove redundant NotificationModule test
Magnus-Kuhn Feb 20, 2024
6081f5e
Merge branch 'main' into refactor/decouple-runtime-tests
mergify[bot] Feb 20, 2024
396322d
refactor: decouple draft tests
Magnus-Kuhn Feb 20, 2024
a596f2d
refactor: return relationship in testUtil functions
Magnus-Kuhn Feb 20, 2024
bd0fd1d
Revert "refactor: remove redundant NotificationModule test"
Magnus-Kuhn Feb 20, 2024
e413149
refactor: decouple ComplexReadAttribute tests
Magnus-Kuhn Feb 20, 2024
81a3f4e
Merge branch 'main' into refactor/decouple-runtime-tests
mergify[bot] Feb 20, 2024
5a9e965
refactor: fewer message runtime test utilities
Magnus-Kuhn Feb 21, 2024
3999157
refactor: decouple some ReadAttributeRequest tests (draft)
Magnus-Kuhn Feb 21, 2024
322cd77
refactor: decouple all runtime tests
Magnus-Kuhn Feb 22, 2024
996ff5c
refactor: move iqlQuery helpers back into the test file
Magnus-Kuhn Feb 22, 2024
a9237e0
fix/refactor: fix runtime tests/add baseline
Magnus-Kuhn Feb 22, 2024
a6c631a
Merge branch 'main' into refactor/decouple-runtime-tests
mergify[bot] Feb 22, 2024
33088dc
Merge branch 'refactor/decouple-runtime-tests' of https://github.com/…
Magnus-Kuhn Feb 22, 2024
2e12f74
fix: re-add eventBus resetting in tests
Magnus-Kuhn Feb 22, 2024
48f0644
Merge branch 'main' into refactor/decouple-runtime-tests
mergify[bot] Feb 23, 2024
b760b10
refactor: remaining DVO tests
Magnus-Kuhn Feb 23, 2024
dca0828
Merge branch 'refactor/decouple-runtime-tests' of https://github.com/…
Magnus-Kuhn Feb 23, 2024
51f48c8
refactor: remove unused code
Magnus-Kuhn Feb 26, 2024
f4d7e4e
refactor: decouple last tests
Magnus-Kuhn Feb 27, 2024
fa4f37b
Merge branch 'main' into refactor/decouple-runtime-tests
mergify[bot] Feb 27, 2024
91fd090
fix: properly use RelationshipTemlate content
jkoenig134 Feb 28, 2024
71794de
fix: RepositoryAttributeDVO test errors
Magnus-Kuhn Feb 28, 2024
1d56501
fix: errors in MessageDVO, RelationshipTemplateDVO tests
Magnus-Kuhn Feb 28, 2024
4476b47
chore: satisfy the linter
Magnus-Kuhn Feb 28, 2024
55e6117
Merge branch 'main' into refactor/decouple-runtime-tests
mergify[bot] Feb 28, 2024
0e1be48
refactor: separate testUtils for tests without active modules
Magnus-Kuhn Feb 28, 2024
50904d9
refactor: variable renaming iqlQuery/request tests
Magnus-Kuhn Feb 28, 2024
ecc122a
refactor: remove unused testUtils
Magnus-Kuhn Feb 28, 2024
1b65d09
refactor: prettier responseItems in complexReadAttribute test
Magnus-Kuhn Feb 28, 2024
f758934
Merge branch 'main' into refactor/decouple-runtime-tests
mergify[bot] Feb 28, 2024
99cca54
Merge branch 'main' into refactor/decouple-runtime-tests
mergify[bot] Feb 28, 2024
1fff17d
refactor: use baseline in tests
Magnus-Kuhn Feb 29, 2024
86b9c4e
refactor: use baseline in fewer instances
Magnus-Kuhn Feb 29, 2024
4d1ac9c
refactor: change variable name in message test
Magnus-Kuhn Feb 29, 2024
5effbb8
refactor: add baseline/tests for number of attributes
Magnus-Kuhn Feb 29, 2024
edb3815
refactor: remove unused code
Magnus-Kuhn Feb 29, 2024
8a55ba1
Merge branch 'refactor/decouple-runtime-tests' of https://github.com/…
Magnus-Kuhn Feb 29, 2024
a96fb4a
Merge branch 'main' into refactor/decouple-runtime-tests
mergify[bot] Feb 29, 2024
5c8b29c
Merge branch 'main' into refactor/decouple-runtime-tests
mergify[bot] Feb 29, 2024
a084a51
refactor: remove unused code in attributes-e2e
Magnus-Kuhn Feb 29, 2024
cbbf0ab
Merge branch 'refactor/decouple-runtime-tests' of https://github.com/…
Magnus-Kuhn Feb 29, 2024
cd6d3b3
refactor: move the e2e-test into the attributes test
Magnus-Kuhn Mar 1, 2024
24b02bf
fix: namings, linters, decouplings
Magnus-Kuhn Mar 6, 2024
d9bde62
refactor: remove comment
Magnus-Kuhn Mar 6, 2024
af560ba
fix: failing request module tests
Magnus-Kuhn Mar 6, 2024
1766b3b
refactor: change variable name
Magnus-Kuhn Mar 6, 2024
24ad94f
Merge branch 'main' into refactor/decouple-runtime-tests
slavistan Mar 6, 2024
172a127
fix: wait for an event in the requests test
Magnus-Kuhn Mar 6, 2024
1d9fbed
fix: wait for PeerRelationshipTemplateLoadedEvent
Milena-Czierlinski Mar 6, 2024
e7177cd
Merge branch 'refactor/decouple-runtime-tests' of github.com:nmshd/ru…
Milena-Czierlinski Mar 6, 2024
996e920
fix: syntax error
Magnus-Kuhn Mar 6, 2024
aade598
fix: wait for events in attribute dvo tests
Magnus-Kuhn Mar 6, 2024
fff75c6
Merge branch 'main' into refactor/decouple-runtime-tests
mergify[bot] Mar 6, 2024
de12a04
fix: waiting for wrong events
Magnus-Kuhn Mar 6, 2024
9ab424c
Merge branch 'refactor/decouple-runtime-tests' of https://github.com/…
Magnus-Kuhn Mar 6, 2024
0380f63
Merge branch 'main' into refactor/decouple-runtime-tests
mergify[bot] Mar 6, 2024
6096a2b
Merge branch 'refactor/decouple-runtime-tests' of https://github.com/…
Magnus-Kuhn Mar 6, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ import {
CompleteIncomingRequestRequest,
CompleteIncomingRequestUseCase,
GetIncomingRequestRequest,
GetIncomingRequestUseCase,
GetIncomingRequestsRequest,
GetIncomingRequestsUseCase,
GetIncomingRequestUseCase,
ReceivedIncomingRequestRequest,
ReceivedIncomingRequestUseCase,
RejectIncomingRequestRequest,
Expand Down
1,003 changes: 0 additions & 1,003 deletions packages/runtime/test/consumption/attributes-e2e.test.ts

This file was deleted.

940 changes: 916 additions & 24 deletions packages/runtime/test/consumption/attributes.test.ts

Large diffs are not rendered by default.

63 changes: 44 additions & 19 deletions packages/runtime/test/consumption/drafts.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,56 +12,81 @@ afterAll(async () => await runtimeServiceProvider.stop());

describe("Drafts", () => {
const content = { aKey: "a-Value" };
let draftId: string;

test("should create a draft", async () => {
const result = await consumptionServices.drafts.createDraft({ content: content, type: "test" });

expect(result).toBeSuccessful();

const draft = result.value;
draftId = draft.id;
});

test("should get the draft", async () => {
const result = await consumptionServices.drafts.getDraft({ id: draftId });
expect(result).toBeSuccessful();
const creationResult = await consumptionServices.drafts.createDraft({ content: content, type: "test" });

const draft = result.value;
expect(creationResult).toBeSuccessful();

const draftId = creationResult.value.id;

const getResult = await consumptionServices.drafts.getDraft({ id: draftId });
expect(getResult).toBeSuccessful();

const draft = getResult.value;
expect(draft.content).toStrictEqual(content);
});

test("should have query the draft", async () => {
const result = await consumptionServices.drafts.getDrafts({});
expect(result).toBeSuccessful();
const baselineNumberOfDrafts = (await consumptionServices.drafts.getDrafts({})).value.length;

const creationResult = await consumptionServices.drafts.createDraft({ content: content, type: "test" });

expect(creationResult).toBeSuccessful();

const draftId = creationResult.value.id;

const drafts = result.value;
expect(drafts).toHaveLength(1);
const getResult = await consumptionServices.drafts.getDrafts({});
expect(getResult).toBeSuccessful();

expect(drafts[0].id).toStrictEqual(draftId);
const drafts = getResult.value;
const numberOfDrafts = drafts.length;
expect(numberOfDrafts - baselineNumberOfDrafts).toBe(1);

expect(drafts[numberOfDrafts - 1].id).toStrictEqual(draftId);
});

test("should edit the draft", async () => {
const creationResult = await consumptionServices.drafts.createDraft({ content: content, type: "test" });

expect(creationResult).toBeSuccessful();

const draftId = creationResult.value.id;

const newContent = { aKey: "another-Value" };
const updateResult = await consumptionServices.drafts.updateDraft({ id: draftId, content: newContent });
expect(updateResult).toBeSuccessful();

const result = await consumptionServices.drafts.getDraft({ id: draftId });
expect(result).toBeSuccessful();
const getResult = await consumptionServices.drafts.getDraft({ id: draftId });
expect(getResult).toBeSuccessful();

const draft = result.value;
const draft = getResult.value;
expect(draft.content).toStrictEqual(newContent);
});

test("should delete the draft", async () => {
const creationResult = await consumptionServices.drafts.createDraft({ content: content, type: "test" });

expect(creationResult).toBeSuccessful();

const draftId = creationResult.value.id;

const baselineNumberOfDrafts = (await consumptionServices.drafts.getDrafts({})).value.length;
const deleteResult = await consumptionServices.drafts.deleteDraft({ id: draftId });
expect(deleteResult).toBeSuccessful();

const result = await consumptionServices.drafts.getDrafts({});
expect(result).toBeSuccessful();
const getResult = await consumptionServices.drafts.getDrafts({});
expect(getResult).toBeSuccessful();

const drafts = result.value;
expect(drafts).toHaveLength(0);
const drafts = getResult.value;
const numberOfDrafts = drafts.length;
expect(baselineNumberOfDrafts - numberOfDrafts).toBe(1);
});
});

Expand Down
Loading