Skip to content

Commit 2dcaecd

Browse files
test: Use simulation options for initial state (#3398)
Use the simulation option to specify the initial state for the manage state example Snap tests.
1 parent cc47984 commit 2dcaecd

File tree

1 file changed

+9
-19
lines changed

1 file changed

+9
-19
lines changed

packages/examples/packages/manage-state/src/index.test.ts

Lines changed: 9 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -133,12 +133,9 @@ describe('onRpcRequest', () => {
133133
});
134134

135135
it('returns the state', async () => {
136-
const { request } = await installSnap();
137-
138-
await request({
139-
method: 'setState',
140-
params: {
141-
value: {
136+
const { request } = await installSnap({
137+
options: {
138+
state: {
142139
items: ['foo'],
143140
},
144141
},
@@ -154,12 +151,9 @@ describe('onRpcRequest', () => {
154151
});
155152

156153
it('returns the state at a specific key', async () => {
157-
const { request } = await installSnap();
158-
159-
await request({
160-
method: 'setState',
161-
params: {
162-
value: {
154+
const { request } = await installSnap({
155+
options: {
156+
state: {
163157
nested: {
164158
key: 'foo',
165159
},
@@ -178,15 +172,11 @@ describe('onRpcRequest', () => {
178172
});
179173

180174
it('returns the unencrypted state', async () => {
181-
const { request } = await installSnap();
182-
183-
await request({
184-
method: 'setState',
185-
params: {
186-
value: {
175+
const { request } = await installSnap({
176+
options: {
177+
unencryptedState: {
187178
items: ['foo'],
188179
},
189-
encrypted: false,
190180
},
191181
});
192182

0 commit comments

Comments
 (0)