Skip to content

Commit d7b1205

Browse files
committed
test: fix core tests
1 parent 4711b01 commit d7b1205

34 files changed

+61
-506
lines changed

packages/core-tests/components.test.ts

Lines changed: 0 additions & 284 deletions
This file was deleted.

packages/core-tests/lib/components.test.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,8 @@ import { expect } from 'chai'
55
import { ex } from '@shaperone/testing'
66
import { rdfs, schema, skos } from '@tpluscode/rdf-ns-builders'
77
import rdf from '@shaperone/testing/env.js'
8-
import { setEnv } from '@hydrofoil/shaperone-core/env.js'
98

109
describe('core/lib/components', () => {
11-
before(async () => {
12-
await setEnv(rdf)
13-
})
14-
1510
describe('sort', () => {
1611
it('sorts by rdf:label by default', () => {
1712
// given

packages/core-tests/lib/property.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ describe('core/lib/property', () => {
1717
}
1818

1919
// when
20-
const term = createTerm($rdf, property, 'http://foo/bar')
20+
const term = createTerm(property, 'http://foo/bar')
2121

2222
// then
2323
expect(term.value).to.equal('http://foo/bar')
@@ -32,7 +32,7 @@ describe('core/lib/property', () => {
3232
}
3333

3434
// when
35-
const term = createTerm($rdf, property, '41')
35+
const term = createTerm(property, '41')
3636

3737
// then
3838
expect(term).to.deep.equal($rdf.literal('41', xsd.int))

packages/core-tests/models/components/reducers.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { describe, it } from 'mocha'
22
import { expect } from 'chai'
33
import { dash } from '@tpluscode/rdf-ns-builders/loose'
44
import reducers from '@hydrofoil/shaperone-core/models/components/reducers.js'
5-
import type { Component, ComponentDecorator, ComponentsState } from '@hydrofoil/shaperone-core/models/components'
5+
import type { Component, ComponentDecorator, ComponentsState } from '@hydrofoil/shaperone-core/models/components/index.js'
66
import env from '@shaperone/testing/env.js'
77
import { setEnv } from '@hydrofoil/shaperone-core/env.js'
88

packages/core-tests/models/editors/effects/loadDash.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { describe, it } from 'mocha'
22
import { expect } from 'chai'
33
import { testStore } from '@shaperone/testing/models/form.js'
4-
import type { Store } from '@hydrofoil/shaperone-core/state'
4+
import type { Store } from '@hydrofoil/shaperone-core/state/index.js'
55
import { loadDash } from '@hydrofoil/shaperone-core/models/editors/effects/index.js'
66

77
describe('models/editors/effects/loadDash', () => {

packages/core-tests/models/editors/lib/match.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { dash } from '@tpluscode/rdf-ns-builders/loose'
55
import type { NamedNode } from '@rdfjs/types'
66
import { expect } from 'chai'
77
import { testStore } from '@shaperone/testing/models/form.js'
8-
import type { Editor, EditorsState, MultiEditor } from '@hydrofoil/shaperone-core/models/editors'
8+
import type { Editor, EditorsState, MultiEditor } from '@hydrofoil/shaperone-core/models/editors/index.js'
99
import { matchSingleEditors, matchMultiEditors } from '@hydrofoil/shaperone-core/models/editors/lib/match.js'
1010
import { propertyShape } from '@shaperone/testing/util.js'
1111

packages/core-tests/models/editors/reducers/decorate.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { dash } from '@tpluscode/rdf-ns-builders/loose'
44
import { testEditor } from '@shaperone/testing/models/form.js'
55
import { testEditorsState as testState } from '@shaperone/testing/models/editors.js'
66
import { decorate } from '@hydrofoil/shaperone-core/models/editors/reducers/decorate.js'
7-
import type { MatcherDecorator, SingleEditor } from '@hydrofoil/shaperone-core/models/editors'
7+
import type { MatcherDecorator, SingleEditor } from '@hydrofoil/shaperone-core/models/editors/index.js'
88

99
describe('core/models/editors/reducers/decorate', () => {
1010
it('creates decorator array for editor', () => {

packages/core-tests/models/forms/effects/addObject.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ import { sinon } from '@shaperone/testing'
55
import { dash } from '@tpluscode/rdf-ns-builders/loose'
66
import { testStore } from '@shaperone/testing/models/form.js'
77
import { addObject } from '@hydrofoil/shaperone-core/models/forms/effects/addObject.js'
8-
import type { Store } from '@hydrofoil/shaperone-core/state'
9-
import type { SingleEditorMatch } from '@hydrofoil/shaperone-core/models/editors'
8+
import type { Store } from '@hydrofoil/shaperone-core/state/index.js'
9+
import type { SingleEditorMatch } from '@hydrofoil/shaperone-core/models/editors/index.js'
1010
import { propertyShape } from '@shaperone/testing/util.js'
1111
import { sh } from '@tpluscode/rdf-ns-builders'
1212
import { blankNode } from '@shaperone/testing/nodeFactory.js'

packages/core-tests/models/forms/effects/lib/syncProperties.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@ import { expect } from 'chai'
44
import type { sinon } from '@shaperone/testing'
55
import { dash, foaf, schema, sh } from '@tpluscode/rdf-ns-builders'
66
import { testFocusNodeState, testPropertyState, testStore } from '@shaperone/testing/models/form.js'
7-
import type { Dispatch, Store } from '@hydrofoil/shaperone-core/state'
7+
import type { Dispatch, Store } from '@hydrofoil/shaperone-core/state/index.js'
88
import { syncProperties } from '@hydrofoil/shaperone-core/models/forms/effects/lib/syncProperties.js'
9-
import type { EditorsState } from '@hydrofoil/shaperone-core/models/editors'
10-
import type { State } from '@hydrofoil/shaperone-core/models/forms'
9+
import type { EditorsState } from '@hydrofoil/shaperone-core/models/editors/index.js'
10+
import type { State } from '@hydrofoil/shaperone-core/models/forms/index.js'
1111
import { nodeShape, propertyShape } from '@shaperone/testing/util.js'
1212

1313
describe('models/forms/effects/lib/syncProperties', () => {

packages/core-tests/models/forms/effects/pushFocusNode.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { expect } from 'chai'
44
import { sinon } from '@shaperone/testing'
55
import { testStore } from '@shaperone/testing/models/form.js'
66
import { pushFocusNode } from '@hydrofoil/shaperone-core/models/forms/effects/pushFocusNode.js'
7-
import type { Store } from '@hydrofoil/shaperone-core/state'
7+
import type { Store } from '@hydrofoil/shaperone-core/state/index.js'
88
import { propertyShape } from '@shaperone/testing/util.js'
99

1010
describe('models/forms/effects/pushFocusNode', () => {

0 commit comments

Comments
 (0)