-
Notifications
You must be signed in to change notification settings - Fork 21
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
feat: 3601 - Follow/Notes updates to My Grants #3633
Merged
Merged
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
71b86cd
feat: 3601 - my grants with follow notes
phm200 3303ce9
feat: update tab specific urls when followNotesEnabled
phm200 deab3e5
feat: get followed by grants
phm200 0b7f229
feat: add in followed by, fix sorting
phm200 ae57ffb
Merge branch 'main' into feat/3601_follow_notes_my_grants
phm200 8d7cafc
feat: get tests passing again
phm200 7370099
feat: fix CSV export
phm200 0217c6a
feat: clean up enhance grant data with feature flag use
phm200 1ae55a2
feat: consistent use of tables constant
phm200 2bb7500
Merge branch 'main' into feat/3601_follow_notes_my_grants
TylerHendrickson ec539b8
Merge branch 'main' into feat/3601_follow_notes_my_grants
TylerHendrickson File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,40 +1,121 @@ | ||
import MyGrantsView from '@/views/MyGrantsView.vue'; | ||
|
||
import { | ||
describe, it, expect, vi, | ||
describe, it, expect, vi, beforeEach, | ||
} from 'vitest'; | ||
import { shallowMount } from '@vue/test-utils'; | ||
import { createStore } from 'vuex'; | ||
import { shareTerminologyEnabled, followNotesEnabled } from '@/helpers/featureFlags'; | ||
import GrantsTable from '@/components/GrantsTable.vue'; | ||
|
||
vi.mock('bootstrap-vue', async () => ({ | ||
// SavedSearchPanel imports bootstrap-vue, which triggers an error in testing, so we'll mock it out | ||
VBToggle: vi.fn(), | ||
})); | ||
|
||
describe('MyGrantsView', () => { | ||
const store = createStore({ | ||
getters: { | ||
'users/selectedAgencyId': () => '123', | ||
}, | ||
}); | ||
const $route = { | ||
params: { | ||
tab: 'applied', | ||
}, | ||
meta: { | ||
tabNames: ['interested', 'applied'], | ||
}, | ||
}; | ||
|
||
it('renders', () => { | ||
const wrapper = shallowMount(MyGrantsView, { | ||
global: { | ||
plugins: [store], | ||
mocks: { | ||
$route, | ||
vi.mock('@/helpers/featureFlags', async (importOriginal) => ({ | ||
...await importOriginal(), | ||
shareTerminologyEnabled: vi.fn(), | ||
followNotesEnabled: vi.fn(), | ||
})); | ||
|
||
describe('MyGrantsView.vue', () => { | ||
describe('when follow notes flag is off', () => { | ||
const store = createStore({ | ||
getters: { | ||
'users/selectedAgencyId': () => '123', | ||
}, | ||
}); | ||
const $route = { | ||
params: { | ||
tab: 'applied', | ||
}, | ||
meta: { | ||
tabNames: ['interested', 'applied'], | ||
}, | ||
}; | ||
|
||
beforeEach(() => { | ||
vi.mocked(shareTerminologyEnabled).mockReturnValue(true); | ||
vi.mocked(followNotesEnabled).mockReturnValue(false); | ||
}); | ||
|
||
it('renders', () => { | ||
const wrapper = shallowMount(MyGrantsView, { | ||
global: { | ||
plugins: [store], | ||
mocks: { | ||
$route, | ||
}, | ||
}, | ||
}); | ||
expect(wrapper.exists()).toBe(true); | ||
|
||
// check tab titles | ||
const html = wrapper.html(); | ||
expect(html).toContain('title="Shared With Your Team"'); | ||
expect(html).toContain('title="Interested"'); | ||
expect(html).toContain('title="Not Applying"'); | ||
expect(html).toContain('title="Applied"'); | ||
expect(html).not.toContain('title="Shared With My Team"'); | ||
expect(html).not.toContain('title="Followed by My Team"'); | ||
|
||
// check tab order and table search title props | ||
const tabs = wrapper.findAllComponents(GrantsTable); | ||
expect(tabs.length).toEqual(4); | ||
expect(tabs[0].props().searchTitle).toEqual('Shared With Your Team'); | ||
expect(tabs[1].props().searchTitle).toEqual('Interested'); | ||
expect(tabs[2].props().searchTitle).toEqual('Not Applying'); | ||
expect(tabs[3].props().searchTitle).toEqual('Applied'); | ||
}); | ||
}); | ||
|
||
describe('when follow notes flag is on', () => { | ||
const store = createStore({ | ||
getters: { | ||
'users/selectedAgencyId': () => '123', | ||
}, | ||
}); | ||
const $route = { | ||
// @todo: adjust these for new tab names? | ||
params: { | ||
tab: 'applied', | ||
}, | ||
meta: { | ||
tabNames: ['interested', 'applied'], | ||
}, | ||
}; | ||
|
||
beforeEach(() => { | ||
vi.mocked(shareTerminologyEnabled).mockReturnValue(true); | ||
vi.mocked(followNotesEnabled).mockReturnValue(true); | ||
}); | ||
|
||
it('renders', () => { | ||
const wrapper = shallowMount(MyGrantsView, { | ||
global: { | ||
plugins: [store], | ||
mocks: { | ||
$route, | ||
}, | ||
}, | ||
}); | ||
expect(wrapper.exists()).toBe(true); | ||
|
||
// check tab titles | ||
const html = wrapper.html(); | ||
expect(html).toContain('title="Shared With My Team"'); | ||
expect(html).toContain('title="Followed by My Team"'); | ||
expect(html).not.toContain('title="Shared With Your Team"'); | ||
expect(html).not.toContain('title="Interested"'); | ||
expect(html).not.toContain('title="Not Applying"'); | ||
expect(html).not.toContain('title="Applied"'); | ||
|
||
// check tab order and table search title props | ||
const tabs = wrapper.findAllComponents(GrantsTable); | ||
expect(tabs.length).toEqual(2); | ||
expect(tabs[0].props().searchTitle).toEqual('Shared With My Team'); | ||
expect(tabs[1].props().searchTitle).toEqual('Followed by My Team'); | ||
}); | ||
expect(wrapper.exists()).toBe(true); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,8 +8,15 @@ COOKIE_SECRET=itsasecretsecretsecret | |
WEBSITE_DOMAIN=http://localhost:8080 | ||
API_DOMAIN=http://localhost:8080 | ||
|
||
# feature flags | ||
ENABLE_GRANTS_SCRAPER=true | ||
SHARE_TERMINOLOGY_ENABLED=true | ||
ENABLE_NEW_TEAM_TERMINOLOGY=true | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. adding in the other feature flags I've seen used throughout the code for reference in the example env |
||
ENABLE_GRANT_DIGEST_SCHEDULED_TASK=true | ||
ENABLE_SAVED_SEARCH_GRANTS_DIGEST=true | ||
ENABLE_FOLLOW_NOTES=true | ||
|
||
|
||
GRANTS_SCRAPER_DATE_RANGE=7 | ||
GRANTS_SCRAPER_DELAY=1000 | ||
NODE_OPTIONS=--max_old_space_size=1024 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 component is very lightly tested and I'd like to return to add more test coverage here, but that can be done as a follow up PR; especially as we are likely removing some code soon for feature flag removal and therefore can reduce the test surface to cover