-
Notifications
You must be signed in to change notification settings - Fork 42
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
User store tests #245
User store tests #245
Conversation
need to fix agent tests
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.
A couple small comments and looks like there's a changelog conflict but otherwise LGTM @zhen0
).tenant | ||
)?.tenant | ||
|
||
const firstTenant = | ||
getters['memberships']?.[0] || rootGetters['tenant/tenants'] | ||
|
||
if (!defaultMembershipId || rootGetters['api/isServer']) return firstTenant | ||
getters['memberships']?.[0]?.tenant || rootGetters['tenant/tenants']?.[0] |
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.
Really good catches on this, hopefully this'll fix some of those edge cases with missing tenants on load.
first_name: '', | ||
last_name: '', |
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.
These were missing for long enough that I think we should add a templating function for this user state. We can do that in a follow-up PR though.
store.commit('setAgents', [{ id: '12345' }]) | ||
expect(store.getters.agents).toEqual([ | ||
{ id: '12345', secondsSinceLastQuery: 0 } | ||
]) |
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.
Does this introduce a potential race-conditional test failure? There should never be a full second between lines 61 and 63 but...
Merge conflict fixed @znicholasbrown - can you approve again? |
PR Checklist:
CHANGELOG.md
Describe this PR