-
Notifications
You must be signed in to change notification settings - Fork 1
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
Extract API implementations from Post Login API #12
Conversation
6cc1293
to
05345c5
Compare
f938640
to
c0535e7
Compare
4a63776
to
b4e1b3c
Compare
examples/jsconfig.json
Outdated
"compilerOptions": { | ||
"moduleResolution": "nodenext" | ||
} | ||
} |
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.
This was in place to help type hinting (e.g. in VS Code). Have agreed to back this out as we're no longer depending on complicated TS exports.
"/sandwich-preferences", | ||
"Unexpected redirect URL path" | ||
); | ||
|
||
// Test the signed JWT data payload | ||
const { session_token } = redirect.queryParams; | ||
const { session_token } = redirect.target.queryParams; |
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.
We'll revert this in the future (e.g. with a Proxy object) as this just creates an unnecessary property to have to type. See #19.
src/mock/api/rules.ts
Outdated
|
||
const build = <T>(api: T) => ({ | ||
wasExecuted: (ruleId: string) => { | ||
return state.executed.includes(ruleId);; |
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.
return state.executed.includes(ruleId);; | |
return state.executed.includes(ruleId); |
src/mock/api/rules.ts
Outdated
export function rulesMock(flow: string, { executedRules = [] }: { executedRules?: string[] } = {}) { | ||
const state = { | ||
executed: executedRules, | ||
}; |
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.
Let's not put this in the state for now. It's only a value you can set in your preconditions. An Action can't modify this, so there will never be a need to test it in postconditions.
b4e1b3c
to
cd2259e
Compare
cd2259e
to
042fc6f
Compare
Starting point to DRY up API implementation so behaviour can be shared across flows.