-
Notifications
You must be signed in to change notification settings - Fork 60
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* update user roles update window * final tweaks * syncing with origin * added filterValidation tests * finished tests for bountyHeaderLanguageFilter, bountyHeaderFilter functions * prettier * bug fix * fixed a/t/t test * test: fixed test to pass * fix: no new yarn.lock --------- Co-authored-by: kevkevin <oapallikunnel@gmail.com>
- Loading branch information
1 parent
ca1c253
commit 01b20d3
Showing
2 changed files
with
60 additions
and
0 deletions.
There are no files selected for viewing
50 changes: 50 additions & 0 deletions
50
frontend/app/src/people/utils/__tests__/filterValidation.spec.ts
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 |
---|---|---|
@@ -0,0 +1,50 @@ | ||
import { bountyHeaderFilter, bountyHeaderLanguageFilter } from '../filterValidation'; | ||
|
||
describe('testing filters', () => { | ||
describe('bountyHeaderFilter', () => { | ||
test('o/t/t', () => { | ||
expect(bountyHeaderFilter({ Open: true }, true, true)).toEqual(false); | ||
}); | ||
test('a/t/t', () => { | ||
expect(bountyHeaderFilter({ Assigned: true }, true, true)).toEqual(false); | ||
}); | ||
test('p/t/t', () => { | ||
expect(bountyHeaderFilter({ Paid: true }, true, true)).toEqual(true); | ||
}); | ||
test('/t/t', () => { | ||
expect(bountyHeaderFilter({}, true, true)).toEqual(true); | ||
}); | ||
test('o/f/t', () => { | ||
expect(bountyHeaderFilter({ Open: true }, false, true)).toEqual(false); | ||
}); | ||
test('a/f/t', () => { | ||
expect(bountyHeaderFilter({ Assigned: true }, false, true)).toEqual(true); | ||
}); | ||
test('p/f/t', () => { | ||
expect(bountyHeaderFilter({ Paid: true }, false, true)).toEqual(false); | ||
}); | ||
}); | ||
describe('bountyHeaderLanguageFilter', () => { | ||
test('match', () => { | ||
expect(bountyHeaderLanguageFilter(['Javascript', 'Python'], { Javascript: true })).toEqual( | ||
false | ||
); | ||
}); | ||
test('no-match', () => { | ||
expect( | ||
bountyHeaderLanguageFilter(['Javascript'], { Python: true, Javascript: false }) | ||
).toEqual(false); | ||
}); | ||
test('no filters', () => { | ||
expect(bountyHeaderLanguageFilter(['Javascript'], {})).toEqual(true); | ||
}); | ||
test('no languages', () => { | ||
expect(bountyHeaderLanguageFilter([], { Javascript: true })).toEqual(false); | ||
}); | ||
test('false filters', () => { | ||
expect( | ||
bountyHeaderLanguageFilter(['Javascript'], { Javascript: false, Python: false }) | ||
).toEqual(true); | ||
}); | ||
}); | ||
}); |
10 changes: 10 additions & 0 deletions
10
frontend/app/src/people/widgetViews/__tests__/WidgetSwitchViewer.spec.tsx
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 |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import WidgetViewer from '../WidgetSwitchViewer'; | ||
import { uiStore } from '../../../store/ui'; | ||
// import crypto from 'crypto'; | ||
// import moment from 'moment'; | ||
|
||
beforeAll(() => {}); | ||
|
||
afterAll(() => {}); | ||
|
||
describe('testing helpers', () => {}); |