@goliapkg/smix 1.0.27 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +53 -130
- package/dist/A11yNode.d.ts.map +1 -1
- package/dist/A11yNode.js +2 -3
- package/dist/A11yNode.js.map +1 -1
- package/dist/App.d.ts +37 -22
- package/dist/App.d.ts.map +1 -1
- package/dist/App.js +72 -66
- package/dist/App.js.map +1 -1
- package/dist/ExpectationFailure.d.ts +8 -1
- package/dist/ExpectationFailure.d.ts.map +1 -1
- package/dist/ExpectationFailure.js +7 -7
- package/dist/ExpectationFailure.js.map +1 -1
- package/dist/HttpRunner.d.ts +9 -31
- package/dist/HttpRunner.d.ts.map +1 -1
- package/dist/HttpRunner.js +14 -100
- package/dist/HttpRunner.js.map +1 -1
- package/dist/Locator.d.ts +7 -9
- package/dist/Locator.d.ts.map +1 -1
- package/dist/Locator.js +17 -18
- package/dist/Locator.js.map +1 -1
- package/dist/NodeDriver.d.ts +53 -0
- package/dist/NodeDriver.d.ts.map +1 -0
- package/dist/NodeDriver.js +70 -0
- package/dist/NodeDriver.js.map +1 -0
- package/dist/Pattern.js +2 -2
- package/dist/Pattern.js.map +1 -1
- package/dist/Selector.d.ts.map +1 -1
- package/dist/Selector.js +5 -8
- package/dist/Selector.js.map +1 -1
- package/dist/SelectorResolver.d.ts +4 -6
- package/dist/SelectorResolver.d.ts.map +1 -1
- package/dist/SelectorResolver.js +5 -8
- package/dist/SelectorResolver.js.map +1 -1
- package/dist/Smix.d.ts +12 -4
- package/dist/Smix.d.ts.map +1 -1
- package/dist/Smix.js +25 -23
- package/dist/Smix.js.map +1 -1
- package/dist/SystemPopup.d.ts +18 -0
- package/dist/SystemPopup.d.ts.map +1 -0
- package/dist/SystemPopup.js +7 -0
- package/dist/SystemPopup.js.map +1 -0
- package/dist/index.d.ts +3 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -1
- package/dist/index.js.map +1 -1
- package/dist/loadNodeDriver.d.ts +21 -0
- package/dist/loadNodeDriver.d.ts.map +1 -0
- package/dist/loadNodeDriver.js +33 -0
- package/dist/loadNodeDriver.js.map +1 -0
- package/package.json +5 -2
- package/src/A11yNode.ts +2 -3
- package/src/App.ts +75 -78
- package/src/ExpectationFailure.ts +23 -13
- package/src/HttpRunner.ts +15 -126
- package/src/Locator.ts +17 -18
- package/src/NodeDriver.ts +109 -0
- package/src/Pattern.ts +2 -2
- package/src/Selector.ts +5 -8
- package/src/SelectorResolver.ts +7 -11
- package/src/Smix.ts +30 -26
- package/src/SystemPopup.ts +24 -0
- package/src/__tests__/AppDriving.test.ts +106 -0
- package/src/__tests__/MvpApiShape.test.ts +78 -46
- package/src/__tests__/ReadmeSnippets.test.ts +132 -0
- package/src/__tests__/RealAddonLoopback.test.ts +81 -0
- package/src/__tests__/SelectorFullSchema.test.ts +2 -4
- package/src/index.ts +19 -8
- package/src/loadNodeDriver.ts +41 -0
- package/src/SimRuntime.ts +0 -145
- package/src/__tests__/AppFullApi.test.ts +0 -168
- package/src/__tests__/AppTapMock.test.ts +0 -122
- package/src/__tests__/HttpRunner.test.ts +0 -121
- package/src/__tests__/Locator.test.ts +0 -128
- package/src/__tests__/LocatorToHave.test.ts +0 -118
|
@@ -1,121 +0,0 @@
|
|
|
1
|
-
// v7.7 c1 — HttpSimRuntime fetch wire integration tests via injected mock.
|
|
2
|
-
//
|
|
3
|
-
// Verifies:
|
|
4
|
-
// - resolver POSTs to /select/resolve with treeJson + selectorJson + decodes ids
|
|
5
|
-
// - labelsResolver POSTs to /select/resolve-labels + decodes labels
|
|
6
|
-
// - resolveCount POSTs to /select/resolve-count + decodes count
|
|
7
|
-
// - Wire body shape matches Rust `{treeJson, selectorJson}` contract
|
|
8
|
-
// - Errors propagate cleanly
|
|
9
|
-
|
|
10
|
-
import { describe, expect, test } from 'vitest'
|
|
11
|
-
import { HttpSimRuntime, type HttpFetch } from '../HttpRunner.js'
|
|
12
|
-
|
|
13
|
-
type CapturedRequest = {
|
|
14
|
-
url: string
|
|
15
|
-
body: string
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
/** Build a mock fetch that captures requests and returns a stub JSON body. */
|
|
19
|
-
function mockFetch(stub: unknown, captured: CapturedRequest[]): HttpFetch {
|
|
20
|
-
return async (url, init) => {
|
|
21
|
-
captured.push({ url, body: init.body })
|
|
22
|
-
return {
|
|
23
|
-
ok: true,
|
|
24
|
-
status: 200,
|
|
25
|
-
json: async () => stub,
|
|
26
|
-
text: async () => JSON.stringify(stub),
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
function failingFetch(): HttpFetch {
|
|
32
|
-
return async (url) => ({
|
|
33
|
-
ok: false,
|
|
34
|
-
status: 500,
|
|
35
|
-
json: async () => ({}),
|
|
36
|
-
text: async () => `server error at ${url}`,
|
|
37
|
-
})
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
describe('HttpSimRuntime.resolver', () => {
|
|
41
|
-
test('POSTs to /select/resolve with treeJson + selectorJson', async () => {
|
|
42
|
-
const captured: CapturedRequest[] = []
|
|
43
|
-
const runtime = new HttpSimRuntime('http://localhost:14101', mockFetch({ ids: ['btn-a', 'btn-b'] }, captured))
|
|
44
|
-
|
|
45
|
-
const ids = await runtime.resolver('{"rawType":"other"}', '{"id":"btn"}')
|
|
46
|
-
|
|
47
|
-
expect(ids).toEqual(['btn-a', 'btn-b'])
|
|
48
|
-
expect(captured.length).toBe(1)
|
|
49
|
-
expect(captured[0]?.url).toBe('http://localhost:14101/select/resolve')
|
|
50
|
-
expect(JSON.parse(captured[0]?.body ?? '')).toEqual({
|
|
51
|
-
treeJson: '{"rawType":"other"}',
|
|
52
|
-
selectorJson: '{"id":"btn"}',
|
|
53
|
-
})
|
|
54
|
-
})
|
|
55
|
-
|
|
56
|
-
test('throws on 500', async () => {
|
|
57
|
-
const runtime = new HttpSimRuntime('http://localhost:14101', failingFetch())
|
|
58
|
-
await expect(runtime.resolver('{}', '{}')).rejects.toMatchObject({
|
|
59
|
-
message: expect.stringContaining('HTTP 500'),
|
|
60
|
-
})
|
|
61
|
-
})
|
|
62
|
-
})
|
|
63
|
-
|
|
64
|
-
describe('HttpSimRuntime.labelsResolver (v7.7 c1)', () => {
|
|
65
|
-
test('POSTs to /select/resolve-labels with treeJson + selectorJson', async () => {
|
|
66
|
-
const captured: CapturedRequest[] = []
|
|
67
|
-
const runtime = new HttpSimRuntime(
|
|
68
|
-
'http://localhost:14101',
|
|
69
|
-
mockFetch({ labels: ['Item 1', 'Item 2', 'Item 3'] }, captured),
|
|
70
|
-
)
|
|
71
|
-
|
|
72
|
-
const labels = await runtime.labelsResolver('{"rawType":"other"}', '{"label":"Item"}')
|
|
73
|
-
|
|
74
|
-
expect(labels).toEqual(['Item 1', 'Item 2', 'Item 3'])
|
|
75
|
-
expect(captured[0]?.url).toBe('http://localhost:14101/select/resolve-labels')
|
|
76
|
-
expect(JSON.parse(captured[0]?.body ?? '')).toEqual({
|
|
77
|
-
treeJson: '{"rawType":"other"}',
|
|
78
|
-
selectorJson: '{"label":"Item"}',
|
|
79
|
-
})
|
|
80
|
-
})
|
|
81
|
-
})
|
|
82
|
-
|
|
83
|
-
describe('HttpSimRuntime.resolveCount (v7.7 c1)', () => {
|
|
84
|
-
test('POSTs to /select/resolve-count and decodes count', async () => {
|
|
85
|
-
const captured: CapturedRequest[] = []
|
|
86
|
-
const runtime = new HttpSimRuntime(
|
|
87
|
-
'http://localhost:14101',
|
|
88
|
-
mockFetch({ count: 7 }, captured),
|
|
89
|
-
)
|
|
90
|
-
|
|
91
|
-
const n = await runtime.resolveCount('{}', '{"role":"button"}')
|
|
92
|
-
|
|
93
|
-
expect(n).toBe(7)
|
|
94
|
-
expect(captured[0]?.url).toBe('http://localhost:14101/select/resolve-count')
|
|
95
|
-
})
|
|
96
|
-
})
|
|
97
|
-
|
|
98
|
-
describe('HttpSimRuntime runtime methods wire shape', () => {
|
|
99
|
-
test('synthesizeTap → POST /input/tap with {x,y}', async () => {
|
|
100
|
-
const captured: CapturedRequest[] = []
|
|
101
|
-
const runtime = new HttpSimRuntime('http://localhost:14101', mockFetch({}, captured))
|
|
102
|
-
await runtime.synthesizeTap(140.5, 220.0)
|
|
103
|
-
expect(captured[0]?.url).toBe('http://localhost:14101/input/tap')
|
|
104
|
-
expect(JSON.parse(captured[0]?.body ?? '')).toEqual({ x: 140.5, y: 220.0 })
|
|
105
|
-
})
|
|
106
|
-
|
|
107
|
-
test('launch → POST /sim/launch with {bundleId}', async () => {
|
|
108
|
-
const captured: CapturedRequest[] = []
|
|
109
|
-
const runtime = new HttpSimRuntime('http://localhost:14101', mockFetch({}, captured))
|
|
110
|
-
await runtime.launch('dev.smix.MyApp')
|
|
111
|
-
expect(captured[0]?.url).toBe('http://localhost:14101/sim/launch')
|
|
112
|
-
expect(JSON.parse(captured[0]?.body ?? '')).toEqual({ bundleId: 'dev.smix.MyApp' })
|
|
113
|
-
})
|
|
114
|
-
|
|
115
|
-
test('synthesizeTapAtNormalized → POST /input/tap-normalized', async () => {
|
|
116
|
-
const captured: CapturedRequest[] = []
|
|
117
|
-
const runtime = new HttpSimRuntime('http://localhost:14101', mockFetch({}, captured))
|
|
118
|
-
await runtime.synthesizeTapAtNormalized(0.5, 0.5)
|
|
119
|
-
expect(captured[0]?.url).toBe('http://localhost:14101/input/tap-normalized')
|
|
120
|
-
})
|
|
121
|
-
})
|
|
@@ -1,128 +0,0 @@
|
|
|
1
|
-
// v7.5 c3 — Locator poll loop tests, mirror Kotlin LocatorMockTest +
|
|
2
|
-
// Swift LocatorMockTests.
|
|
3
|
-
|
|
4
|
-
import { describe, expect, test } from 'vitest'
|
|
5
|
-
import {
|
|
6
|
-
bundleId,
|
|
7
|
-
ExpectationFailure,
|
|
8
|
-
literal,
|
|
9
|
-
MockSelectorResolver,
|
|
10
|
-
MockSimRuntime,
|
|
11
|
-
Selector,
|
|
12
|
-
Smix,
|
|
13
|
-
type A11yNode,
|
|
14
|
-
} from '../index.js'
|
|
15
|
-
|
|
16
|
-
describe('Locator.toBeVisible', () => {
|
|
17
|
-
test('succeeds when initially visible', async () => {
|
|
18
|
-
const node: A11yNode = {
|
|
19
|
-
rawType: 'button',
|
|
20
|
-
identifier: 'btn-x',
|
|
21
|
-
label: 'x',
|
|
22
|
-
bounds: { x: 0, y: 0, w: 10, h: 10 },
|
|
23
|
-
visible: true,
|
|
24
|
-
}
|
|
25
|
-
const tree: A11yNode = {
|
|
26
|
-
rawType: 'other',
|
|
27
|
-
bounds: { x: 0, y: 0, w: 100, h: 100 },
|
|
28
|
-
visible: true,
|
|
29
|
-
children: [node],
|
|
30
|
-
}
|
|
31
|
-
const runtime = new MockSimRuntime({ snapshotResult: tree })
|
|
32
|
-
const resolver = new MockSelectorResolver()
|
|
33
|
-
resolver.registerHit('{"id":"btn-x"}', 'btn-x')
|
|
34
|
-
const app = await Smix.launchApp(bundleId('dev.smix.fixture'), runtime, resolver.resolve)
|
|
35
|
-
await app.find(Selector.id('btn-x')).toBeVisible({ timeoutMs: 500 })
|
|
36
|
-
})
|
|
37
|
-
|
|
38
|
-
test('timeout when never matches', async () => {
|
|
39
|
-
const tree: A11yNode = {
|
|
40
|
-
rawType: 'other',
|
|
41
|
-
bounds: { x: 0, y: 0, w: 100, h: 100 },
|
|
42
|
-
visible: true,
|
|
43
|
-
children: [],
|
|
44
|
-
}
|
|
45
|
-
const runtime = new MockSimRuntime({ snapshotResult: tree })
|
|
46
|
-
const resolver = new MockSelectorResolver()
|
|
47
|
-
const app = await Smix.launchApp(bundleId('dev.smix.fixture'), runtime, resolver.resolve)
|
|
48
|
-
await expect(
|
|
49
|
-
app.find(Selector.id('btn-missing')).toBeVisible({ timeoutMs: 300 }),
|
|
50
|
-
).rejects.toMatchObject({
|
|
51
|
-
name: 'ExpectationFailure',
|
|
52
|
-
code: 'timeout',
|
|
53
|
-
})
|
|
54
|
-
})
|
|
55
|
-
|
|
56
|
-
test('wrongState when matched but hidden', async () => {
|
|
57
|
-
const node: A11yNode = {
|
|
58
|
-
rawType: 'button',
|
|
59
|
-
identifier: 'btn-y',
|
|
60
|
-
label: 'y',
|
|
61
|
-
bounds: { x: 0, y: 0, w: 10, h: 10 },
|
|
62
|
-
visible: false,
|
|
63
|
-
}
|
|
64
|
-
const tree: A11yNode = {
|
|
65
|
-
rawType: 'other',
|
|
66
|
-
bounds: { x: 0, y: 0, w: 100, h: 100 },
|
|
67
|
-
visible: true,
|
|
68
|
-
children: [node],
|
|
69
|
-
}
|
|
70
|
-
const runtime = new MockSimRuntime({ snapshotResult: tree })
|
|
71
|
-
const resolver = new MockSelectorResolver()
|
|
72
|
-
resolver.registerHit('{"id":"btn-y"}', 'btn-y')
|
|
73
|
-
const app = await Smix.launchApp(bundleId('dev.smix.fixture'), runtime, resolver.resolve)
|
|
74
|
-
await expect(
|
|
75
|
-
app.find(Selector.id('btn-y')).toBeVisible({ timeoutMs: 200 }),
|
|
76
|
-
).rejects.toMatchObject({
|
|
77
|
-
name: 'ExpectationFailure',
|
|
78
|
-
code: 'wrongState',
|
|
79
|
-
})
|
|
80
|
-
})
|
|
81
|
-
})
|
|
82
|
-
|
|
83
|
-
describe('Locator.toContainText', () => {
|
|
84
|
-
test('succeeds when label matches', async () => {
|
|
85
|
-
const node: A11yNode = {
|
|
86
|
-
rawType: 'staticText',
|
|
87
|
-
identifier: 'msg',
|
|
88
|
-
label: 'Welcome back, Alice!',
|
|
89
|
-
bounds: { x: 0, y: 0, w: 100, h: 24 },
|
|
90
|
-
visible: true,
|
|
91
|
-
}
|
|
92
|
-
const tree: A11yNode = {
|
|
93
|
-
rawType: 'other',
|
|
94
|
-
bounds: { x: 0, y: 0, w: 100, h: 100 },
|
|
95
|
-
children: [node],
|
|
96
|
-
}
|
|
97
|
-
const runtime = new MockSimRuntime({ snapshotResult: tree })
|
|
98
|
-
const resolver = new MockSelectorResolver()
|
|
99
|
-
resolver.registerHit('{"id":"msg"}', 'msg')
|
|
100
|
-
const app = await Smix.launchApp(bundleId('dev.smix.fixture'), runtime, resolver.resolve)
|
|
101
|
-
await app.find(Selector.id('msg')).toContainText('Alice', { timeoutMs: 500 })
|
|
102
|
-
})
|
|
103
|
-
|
|
104
|
-
test('timeout when never matches', async () => {
|
|
105
|
-
const node: A11yNode = {
|
|
106
|
-
rawType: 'staticText',
|
|
107
|
-
identifier: 'msg',
|
|
108
|
-
label: 'Hello, World',
|
|
109
|
-
bounds: { x: 0, y: 0, w: 100, h: 24 },
|
|
110
|
-
visible: true,
|
|
111
|
-
}
|
|
112
|
-
const tree: A11yNode = {
|
|
113
|
-
rawType: 'other',
|
|
114
|
-
bounds: { x: 0, y: 0, w: 100, h: 100 },
|
|
115
|
-
children: [node],
|
|
116
|
-
}
|
|
117
|
-
const runtime = new MockSimRuntime({ snapshotResult: tree })
|
|
118
|
-
const resolver = new MockSelectorResolver()
|
|
119
|
-
resolver.registerHit('{"id":"msg"}', 'msg')
|
|
120
|
-
const app = await Smix.launchApp(bundleId('dev.smix.fixture'), runtime, resolver.resolve)
|
|
121
|
-
await expect(
|
|
122
|
-
app.find(Selector.id('msg')).toContainText('Goodbye', { timeoutMs: 200 }),
|
|
123
|
-
).rejects.toMatchObject({ code: 'timeout' })
|
|
124
|
-
})
|
|
125
|
-
})
|
|
126
|
-
|
|
127
|
-
// v7.6 c1 update: toHaveLabel + toHaveCount stubs replaced — see
|
|
128
|
-
// LocatorToHave.test.ts for the c1 replacement tests.
|
|
@@ -1,118 +0,0 @@
|
|
|
1
|
-
// v7.6 c1 — Locator.toHaveCount + toHaveLabel mock-based vitest tests.
|
|
2
|
-
|
|
3
|
-
import { describe, expect, test } from 'vitest'
|
|
4
|
-
import {
|
|
5
|
-
bundleId,
|
|
6
|
-
literal,
|
|
7
|
-
MockLabelsResolver,
|
|
8
|
-
MockSelectorResolver,
|
|
9
|
-
MockSimRuntime,
|
|
10
|
-
Selector,
|
|
11
|
-
Smix,
|
|
12
|
-
type A11yNode,
|
|
13
|
-
} from '../index.js'
|
|
14
|
-
|
|
15
|
-
describe('Locator.toHaveCount', () => {
|
|
16
|
-
test('succeeds when match count equals expected', async () => {
|
|
17
|
-
const tree: A11yNode = {
|
|
18
|
-
rawType: 'other',
|
|
19
|
-
bounds: { x: 0, y: 0, w: 100, h: 100 },
|
|
20
|
-
visible: true,
|
|
21
|
-
children: [],
|
|
22
|
-
}
|
|
23
|
-
const runtime = new MockSimRuntime({ snapshotResult: tree })
|
|
24
|
-
const resolver = new MockSelectorResolver()
|
|
25
|
-
const labelsResolver = new MockLabelsResolver()
|
|
26
|
-
labelsResolver.registerLabels('{"label":"Item"}', ['Item', 'Item', 'Item'])
|
|
27
|
-
const app = await Smix.launchApp(
|
|
28
|
-
bundleId('dev.smix.fixture'),
|
|
29
|
-
runtime,
|
|
30
|
-
resolver.resolve,
|
|
31
|
-
labelsResolver.resolve,
|
|
32
|
-
)
|
|
33
|
-
await app.find(Selector.label('Item')).toHaveCount(3, { timeoutMs: 500 })
|
|
34
|
-
})
|
|
35
|
-
|
|
36
|
-
test('throws wrongState when count mismatch', async () => {
|
|
37
|
-
const tree: A11yNode = {
|
|
38
|
-
rawType: 'other',
|
|
39
|
-
bounds: { x: 0, y: 0, w: 100, h: 100 },
|
|
40
|
-
visible: true,
|
|
41
|
-
children: [],
|
|
42
|
-
}
|
|
43
|
-
const runtime = new MockSimRuntime({ snapshotResult: tree })
|
|
44
|
-
const resolver = new MockSelectorResolver()
|
|
45
|
-
const labelsResolver = new MockLabelsResolver()
|
|
46
|
-
labelsResolver.registerLabels('{"label":"Item"}', ['Item']) // 1 match, expect 3
|
|
47
|
-
const app = await Smix.launchApp(
|
|
48
|
-
bundleId('dev.smix.fixture'),
|
|
49
|
-
runtime,
|
|
50
|
-
resolver.resolve,
|
|
51
|
-
labelsResolver.resolve,
|
|
52
|
-
)
|
|
53
|
-
await expect(
|
|
54
|
-
app.find(Selector.label('Item')).toHaveCount(3, { timeoutMs: 200 }),
|
|
55
|
-
).rejects.toMatchObject({
|
|
56
|
-
name: 'ExpectationFailure',
|
|
57
|
-
code: 'wrongState',
|
|
58
|
-
})
|
|
59
|
-
})
|
|
60
|
-
})
|
|
61
|
-
|
|
62
|
-
describe('Locator.toHaveLabel', () => {
|
|
63
|
-
test('succeeds when matched node label equals expected', async () => {
|
|
64
|
-
const node: A11yNode = {
|
|
65
|
-
rawType: 'button',
|
|
66
|
-
identifier: 'btn-x',
|
|
67
|
-
label: 'Submit',
|
|
68
|
-
bounds: { x: 0, y: 0, w: 10, h: 10 },
|
|
69
|
-
visible: true,
|
|
70
|
-
}
|
|
71
|
-
const tree: A11yNode = {
|
|
72
|
-
rawType: 'other',
|
|
73
|
-
bounds: { x: 0, y: 0, w: 100, h: 100 },
|
|
74
|
-
visible: true,
|
|
75
|
-
children: [node],
|
|
76
|
-
}
|
|
77
|
-
const runtime = new MockSimRuntime({ snapshotResult: tree })
|
|
78
|
-
const resolver = new MockSelectorResolver()
|
|
79
|
-
resolver.registerHit('{"id":"btn-x"}', 'btn-x')
|
|
80
|
-
const app = await Smix.launchApp(
|
|
81
|
-
bundleId('dev.smix.fixture'),
|
|
82
|
-
runtime,
|
|
83
|
-
resolver.resolve,
|
|
84
|
-
new MockLabelsResolver().resolve,
|
|
85
|
-
)
|
|
86
|
-
await app.find(Selector.id('btn-x')).toHaveLabel('Submit', { timeoutMs: 500 })
|
|
87
|
-
})
|
|
88
|
-
|
|
89
|
-
test('timeout when label never matches', async () => {
|
|
90
|
-
const node: A11yNode = {
|
|
91
|
-
rawType: 'button',
|
|
92
|
-
identifier: 'btn-x',
|
|
93
|
-
label: 'Cancel',
|
|
94
|
-
bounds: { x: 0, y: 0, w: 10, h: 10 },
|
|
95
|
-
visible: true,
|
|
96
|
-
}
|
|
97
|
-
const tree: A11yNode = {
|
|
98
|
-
rawType: 'other',
|
|
99
|
-
bounds: { x: 0, y: 0, w: 100, h: 100 },
|
|
100
|
-
visible: true,
|
|
101
|
-
children: [node],
|
|
102
|
-
}
|
|
103
|
-
const runtime = new MockSimRuntime({ snapshotResult: tree })
|
|
104
|
-
const resolver = new MockSelectorResolver()
|
|
105
|
-
resolver.registerHit('{"id":"btn-x"}', 'btn-x')
|
|
106
|
-
const app = await Smix.launchApp(
|
|
107
|
-
bundleId('dev.smix.fixture'),
|
|
108
|
-
runtime,
|
|
109
|
-
resolver.resolve,
|
|
110
|
-
new MockLabelsResolver().resolve,
|
|
111
|
-
)
|
|
112
|
-
await expect(
|
|
113
|
-
app.find(Selector.id('btn-x')).toHaveLabel('Submit', { timeoutMs: 200 }),
|
|
114
|
-
).rejects.toMatchObject({
|
|
115
|
-
code: 'timeout',
|
|
116
|
-
})
|
|
117
|
-
})
|
|
118
|
-
})
|