-
Notifications
You must be signed in to change notification settings - Fork 3
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
Mock resources #215
Mock resources #215
Conversation
@kilchenmann What is this PR about? |
Would you like to resolve #62? |
Not primary. I wanted to add a resources-mock file in test/data and saw the different names for the other mock-files. So, the first two commits here were only to make the mock data file names more consistent.
I have to mock a ReadResourceSequence to use for the tests in ui-lib. I will add a description to the PR soon. |
I understand. Sorry, I didn't get it in the first place. Maybe you could just make a mock that returns a Otherwise I can help you with that next week. |
test/data/api/v2/mock-resource.ts
Outdated
@@ -59,4 +59,22 @@ export namespace MockResource { | |||
|
|||
}; | |||
|
|||
export const getTesthings = (length = 25): Observable<ReadResourceSequence> => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you want, you could pass a Boolean arg that would set mayHaveMoreResults
. Maybe that could be useful for testing the search result component?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, why not!?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done in
af0d0d6
export const getTesthings = (length = 25, mayHaveMoreResults = false): Observable<ReadResourceSequence> => { | ||
|
||
const resources: Array<Observable<ReadResource>> = new Array(length).fill(0).map( | ||
() => { | ||
return getTestthing(); | ||
} | ||
); | ||
|
||
return forkJoin(resources).pipe( | ||
map( | ||
(res: ReadResource[]) => { | ||
return new ReadResourceSequence(res, mayHaveMoreResults); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@tobiasschweizer That should work like this, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I think so.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this PR is good to go now.
Thanks |
This PR contains: