Skip to content

Commit

Permalink
fix: Make criterias upper case
Browse files Browse the repository at this point in the history
  • Loading branch information
gromdimon committed Dec 20, 2023
1 parent 17eee05 commit 54ea2f8
Show file tree
Hide file tree
Showing 11 changed files with 336 additions and 349 deletions.
56 changes: 28 additions & 28 deletions backend/app/schemas/acmgseqvar.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,34 +22,34 @@ class Evidence(str, Enum):


class Criteria(str, Enum):
Pvs1 = "Pvs1"
Ps1 = "Ps1"
Ps2 = "Ps2"
Ps3 = "Ps3"
Ps4 = "Ps4"
Pm1 = "Pm1"
Pm2 = "Pm2"
Pm3 = "Pm3"
Pm4 = "Pm4"
Pm5 = "Pm5"
Pm6 = "Pm6"
Pp1 = "Pp1"
Pp2 = "Pp2"
Pp3 = "Pp3"
Pp4 = "Pp4"
Pp5 = "Pp5"
Ba1 = "Ba1"
Bs1 = "Bs1"
Bs2 = "Bs2"
Bs3 = "Bs3"
Bs4 = "Bs4"
Bp1 = "Bp1"
Bp2 = "Bp2"
Bp3 = "Bp3"
Bp4 = "Bp4"
Bp5 = "Bp5"
Bp6 = "Bp6"
Bp7 = "Bp7"
PVS1 = "PVS1"
PS1 = "PS1"
PS2 = "PS2"
PS3 = "PS3"
PS4 = "PS4"
PM1 = "PM1"
PM2 = "PM2"
PM3 = "PM3"
PM4 = "PM4"
PM5 = "PM5"
PM6 = "PM6"
PP1 = "PP1"
PP2 = "PP2"
PP3 = "PP3"
PP4 = "PP4"
PP5 = "PP5"
BA1 = "BA1"
BS1 = "BS1"
BS2 = "BS2"
BS3 = "BS3"
BS4 = "BS4"
BP1 = "BP1"
BP2 = "BP2"
BP3 = "BP3"
BP4 = "BP4"
BP5 = "BP5"
BP6 = "BP6"
BP7 = "BP7"


class SeqVarCriteria(BaseModel):
Expand Down
4 changes: 2 additions & 2 deletions backend/tests/api/api_v1/test_acmgseqvar.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def acmgseqvar_post_data() -> dict[str, Any]:
"comment": "No comment",
"criterias": [
{
"criteria": "Pm4",
"criteria": "PM4",
"presence": "Absent",
"evidence": "Pathogenic Moderate",
}
Expand Down Expand Up @@ -482,7 +482,7 @@ def acmgseqvar_update_data() -> dict[str, Any]:
"comment": "Update",
"criterias": [
{
"criteria": "Pm4",
"criteria": "PM4",
"presence": "Present",
"evidence": "Pathogenic Moderate",
}
Expand Down
2 changes: 1 addition & 1 deletion backend/tests/crud/test_acmgseqvar.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
def acmgseqvar_create() -> AcmgSeqVarCreate:
"""Create a AcmgSeqVarCreate object."""
pm4 = SeqVarCriteria(
criteria=Criteria.Pm4,
criteria=Criteria.PM4,
presence=Presence.Absent,
evidence=Evidence.PathogenicModerate,
)
Expand Down
12 changes: 6 additions & 6 deletions frontend/src/components/__tests__/CriterionSwitch.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import { setupMountedComponents } from '@/lib/test-utils'
describe.concurrent('ClinsigCard', async () => {
it('renders the AcmgRating info', async () => {
const acmgRating = new MultiSourceAcmgCriteriaState()
acmgRating.setPresence(StateSource.InterVar, AcmgCriteria.Pvs1, Presence.Present)
const criteria = AcmgCriteria.Pvs1
acmgRating.setPresence(StateSource.InterVar, AcmgCriteria.PVS1, Presence.Present)
const criteria = AcmgCriteria.PVS1
const criteriaState = acmgRating.getCriteriaState(criteria)

const { wrapper } = await setupMountedComponents(
Expand All @@ -24,19 +24,19 @@ describe.concurrent('ClinsigCard', async () => {
}
)
expect(wrapper.text()).toContain('Pathogenic')
expect(wrapper.text()).toContain('Pvs1')
expect(wrapper.text()).toContain('PVS1')

const switcher = wrapper.find('.v-switch')
expect(switcher.text()).toContain('Pvs1')
expect(switcher.text()).toContain('PVS1')

const selection = wrapper.find('.v-select')
expect(selection.text()).toContain('Pathogenic')
})

it('should correctly update the ClinsigCard info', async () => {
const acmgRating = new MultiSourceAcmgCriteriaState()
acmgRating.setPresence(StateSource.InterVar, AcmgCriteria.Pvs1, Presence.Present)
const criteria = AcmgCriteria.Pvs1
acmgRating.setPresence(StateSource.InterVar, AcmgCriteria.PVS1, Presence.Present)
const criteria = AcmgCriteria.PVS1
const criteriaState = acmgRating.getCriteriaState(criteria)

const { wrapper } = await setupMountedComponents(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,15 @@ const makeWrapper = () => {
store.storeState = StoreState.Active
store.seqvar = deepCopy(seqvarInfo)
store.acmgRating = new MultiSourceAcmgCriteriaState()
store.acmgRating.setPresence(StateSource.InterVar, AcmgCriteria.Pvs1, Presence.Present)
store.acmgRating.setPresence(StateSource.InterVar, AcmgCriteria.PVS1, Presence.Present)
store.acmgRatingStatus = true
})
store.fetchAcmgRating = mockRetrieveAcmgRating

store.storeState = StoreState.Active
store.seqvar = deepCopy(seqvarInfo)
store.acmgRating = new MultiSourceAcmgCriteriaState()
store.acmgRating.setPresence(StateSource.InterVar, AcmgCriteria.Pvs1, Presence.Present)
store.acmgRating.setPresence(StateSource.InterVar, AcmgCriteria.PVS1, Presence.Present)
store.acmgRatingStatus = true

return setupMountedComponents(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,23 +13,23 @@ import { setupMountedComponents } from '@/lib/test-utils'
describe.concurrent('CriterionSwitch', async () => {
it('renders the CriterionSwitch', async () => {
const acmgRating = new MultiSourceAcmgCriteriaState()
acmgRating.setPresence(StateSource.User, AcmgCriteria.Pm1, Presence.Present)
acmgRating.setPresence(StateSource.User, AcmgCriteria.PM1, Presence.Present)
const { wrapper } = await setupMountedComponents(
{ component: CriterionSwitch, template: false },
{
props: {
acmgRating: acmgRating,
criteria: AcmgCriteria.Pm1,
criteria: AcmgCriteria.PM1,
criteriaState: {
criteria: AcmgCriteria.Pm1,
criteria: AcmgCriteria.PM1,
presence: Presence.Present,
evidenceLevel: AcmgEvidenceLevel.PathogenicModerate
}
}
}
)

expect(wrapper.text()).contains('Pm1')
expect(wrapper.text()).contains('PM1')
expect(wrapper.text()).contains('Pathogenic Moderate')
const vSwitch = wrapper.findComponent({ name: 'VSwitch' })
const vTooltip = wrapper.findComponent({ name: 'VTooltip' })
Expand Down
Loading

0 comments on commit 54ea2f8

Please sign in to comment.