Skip to content

Commit

Permalink
test: fix quantifiers
Browse files Browse the repository at this point in the history
  • Loading branch information
tpluscode committed Dec 6, 2024
1 parent efde058 commit dbc7333
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 21 deletions.
11 changes: 0 additions & 11 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 6 additions & 6 deletions packages/core-tests/models/forms/reducers/editors.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ describe('core/models/forms/reducers/editors', () => {

// then
const propertyState = after.focusNodes[focusNode.value].properties[0]
expect(propertyState.objects).to.containAll<PropertyObjectState>(o => o.editorSwitchDisabled === true)
expect(propertyState.objects).to.containAll((o: PropertyObjectState) => o.editorSwitchDisabled === true)
})

it('can enable all editor switches', () => {
Expand All @@ -56,7 +56,7 @@ describe('core/models/forms/reducers/editors', () => {

// then
const propertyState = after.focusNodes[focusNode.value].properties[0]
expect(propertyState.objects).to.containAll<PropertyObjectState>(o => o.editorSwitchDisabled === false)
expect(propertyState.objects).to.containAll((o: PropertyObjectState) => o.editorSwitchDisabled === false)
})
})

Expand Down Expand Up @@ -162,7 +162,7 @@ describe('core/models/forms/reducers/editors', () => {
const objects = Object.values(after.focusNodes)
.flatMap(focusNode => focusNode.properties)
.flatMap(property => property.objects)
expect(objects).to.containAll<PropertyObjectState>(object => dash.TextFieldEditor.equals(object.selectedEditor))
expect(objects).to.containAll((object: PropertyObjectState) => dash.TextFieldEditor.equals(object.selectedEditor))
})

it('sets multi editor if matched', () => {
Expand Down Expand Up @@ -191,7 +191,7 @@ describe('core/models/forms/reducers/editors', () => {
// then
const properties = Object.values(after.focusNodes)
.flatMap(focusNode => focusNode.properties)
expect(properties).to.containAll<PropertyState>(prop => dash.TextFieldEditor.equals(prop.selectedEditor))
expect(properties).to.containAll((prop: PropertyState) => dash.TextFieldEditor.equals(prop.selectedEditor))
})

it('does not change multi editor if previously selected', () => {
Expand Down Expand Up @@ -221,7 +221,7 @@ describe('core/models/forms/reducers/editors', () => {
// then
const properties = Object.values(after.focusNodes)
.flatMap(focusNode => focusNode.properties)
expect(properties).to.containAll<PropertyState>(prop => property.selectedEditor === prop.selectedEditor)
expect(properties).to.containAll((prop: PropertyState) => property.selectedEditor === prop.selectedEditor)
})

it('does not change object editor if previously selected', () => {
Expand Down Expand Up @@ -253,7 +253,7 @@ describe('core/models/forms/reducers/editors', () => {
const objects = Object.values(after.focusNodes)
.flatMap(focusNode => focusNode.properties)
.flatMap(prop => prop.objects)
expect(objects).to.containAll<PropertyObjectState>(obj => obj.selectedEditor?.value === dash.TextFieldEditor.value)
expect(objects).to.containAll((obj: PropertyObjectState) => obj.selectedEditor?.value === dash.TextFieldEditor.value)
})
})
})
4 changes: 2 additions & 2 deletions packages/core-tests/models/forms/reducers/properties.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ describe('@hydrofoil/shaperone-core/models/forms/reducers/properties', () => {
const after = hideProperty(store.getState().form, { focusNode, shape: $rdf.rdfine.sh.NodeShape(shape) })

// then
expect(after.focusNodes[focusNode.value].properties).to.containAll<PropertyState>(shape => shape.hidden)
expect(after.focusNodes[focusNode.value].properties).to.containAll((shape: PropertyState) => shape.hidden)
})
})

Expand Down Expand Up @@ -82,7 +82,7 @@ describe('@hydrofoil/shaperone-core/models/forms/reducers/properties', () => {
const after = showProperty(store.getState().form, { focusNode, shape: $rdf.rdfine.sh.NodeShape(shape) })

// then
expect(after.focusNodes[focusNode.value].properties).to.containAll<PropertyState>(shape => !shape.hidden)
expect(after.focusNodes[focusNode.value].properties).to.containAll((shape: PropertyState) => !shape.hidden)
})
})
})
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ describe('models/resources/effects/forms/createFocusNodeState', () => {

// then
expect(focusNode.out(schema.knows).out(rdf.type).terms)
.containAll<Term>(type => type.equals(schema.Person))
.containAll((type: Term) => type.equals(schema.Person))
})
it('does not add rdf:type to named node children', () => {
// given
Expand Down
1 change: 0 additions & 1 deletion packages/core-tests/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
"mocha": "^11.0.0",
"@types/chai": "^5",
"@types/chai-subset": "^1.3.5",
"@types/chai-quantifiers": "^1.0.4",
"@types/mocha": "^10.0.10",
"@types/sinon-chai": "^3.2.4",
"autoesm": "^1.0.5",
Expand Down

0 comments on commit dbc7333

Please sign in to comment.