Skip to content

Commit

Permalink
Make tests more precise.
Browse files Browse the repository at this point in the history
  • Loading branch information
Ramirisu committed Jan 31, 2024
1 parent a090fd3 commit 8f5a2a9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/data/political_party.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ const POLITICAL_PARTIES = [
weight: {
economic: 35,
environmental: 35,
civil: 35,
civil: 30,
societal: 25,
sovereignty: 20,
us_vs_china: 20,
Expand Down
7 changes: 3 additions & 4 deletions src/pages/quiz/Result.test.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,9 @@ import QUESTIONS from '../../data/question'
import POLITICAL_PARTIES from '../../data/political_party'

const checkWeights = (weights, partyId) => {
console.log(weights)
const getParty = (id) => POLITICAL_PARTIES.filter(value => value.id == id)[0]
const party = getParty(partyId)
const threshold = 5
const threshold = 3
expect(weights.economic).toBeGreaterThanOrEqual(party.weight.economic - threshold)
expect(weights.economic).toBeLessThanOrEqual(party.weight.economic + threshold)
expect(weights.civil).toBeGreaterThanOrEqual(party.weight.civil - threshold)
Expand Down Expand Up @@ -60,9 +59,9 @@ test('kmt', () => {
q0601: MULTIPLIER.d,
q0602: MULTIPLIER.cd,
q0603: MULTIPLIER.cd,
q0604: MULTIPLIER.cd,
q0604: MULTIPLIER.d,
q0605: MULTIPLIER.d,
q0700: MULTIPLIER.ca,
q0700: MULTIPLIER.a,
q0701: MULTIPLIER.a,
q0702: MULTIPLIER.a,
q0703: MULTIPLIER.n,
Expand Down

0 comments on commit 8f5a2a9

Please sign in to comment.