Skip to content
This repository was archived by the owner on Jun 3, 2024. It is now read-only.

Commit c725103

Browse files
committed
fix tests after adding persistence (and fix persistence test for py27)
1 parent 77e793e commit c725103

File tree

5 files changed

+18
-19
lines changed

5 files changed

+18
-19
lines changed

tests/integration/misc/test_persistence.py

+10-19
Original file line numberDiff line numberDiff line change
@@ -150,15 +150,15 @@ def test_msps001_basic_persistence(dash_duo):
150150
]
151151
)
152152
def make_output(*args):
153-
return json.dumps(args, ensure_ascii=False)
153+
return json.dumps(args)
154154

155155
initial_settings = [
156-
["🏎️"],
156+
[u"🏎️"],
157157
"2017-08-21",
158158
"2024-04-08",
159159
"2019-01-01",
160-
"2️⃣",
161-
["4️⃣"],
160+
u"2️⃣",
161+
[u"4️⃣"],
162162
"yes",
163163
"b",
164164
[3, 7],
@@ -168,10 +168,7 @@ def make_output(*args):
168168
]
169169

170170
dash_duo.start_server(app)
171-
dash_duo.wait_for_text_to_equal(
172-
"#settings",
173-
json.dumps(initial_settings, ensure_ascii=False)
174-
)
171+
dash_duo.wait_for_text_to_equal("#settings", json.dumps(initial_settings))
175172

176173
dash_duo.find_element("#checklist label:last-child input").click() # 🚀
177174

@@ -207,12 +204,12 @@ def make_output(*args):
207204
dash_duo.find_element("#textarea").send_keys(Keys.ENTER + "who's there?")
208205

209206
edited_settings = [
210-
["🏎️", "🚀"],
207+
[u"🏎️", u"🚀"],
211208
"2019-05-04",
212209
"2019-05-14",
213210
"2019-01-20",
214-
"1️⃣",
215-
["4️⃣", "6️⃣"],
211+
u"1️⃣",
212+
[u"4️⃣", u"6️⃣"],
216213
"yes maybe",
217214
"r",
218215
[0, 5],
@@ -221,14 +218,8 @@ def make_output(*args):
221218
"knock knock\nwho's there?"
222219
]
223220

224-
dash_duo.wait_for_text_to_equal(
225-
"#settings",
226-
json.dumps(edited_settings, ensure_ascii=False)
227-
)
221+
dash_duo.wait_for_text_to_equal("#settings", json.dumps(edited_settings))
228222

229223
# now reload the page - all of these settings should persist
230224
dash_duo.wait_for_page()
231-
dash_duo.wait_for_text_to_equal(
232-
"#settings",
233-
json.dumps(edited_settings, ensure_ascii=False)
234-
)
225+
dash_duo.wait_for_text_to_equal("#settings", json.dumps(edited_settings))

tests/unit/Checklist.test.js

+2
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ describe('Props can be set properly', () => {
2828
component_name: '',
2929
prop_name: '',
3030
},
31+
persisted_props: ['value'],
32+
persistence_type: 'local',
3133
};
3234

3335
const testProps = Object.assign({}, testPropsNoValue, {value: ['a', 2]});

tests/unit/Dropdown.test.js

+2
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ describe('Props can be set properly', () => {
3131
component_name: '',
3232
prop_name: '',
3333
},
34+
persisted_props: ['value'],
35+
persistence_type: 'local',
3436
};
3537

3638
const multiProps = Object.assign({}, singleProps, {

tests/unit/Input.test.js

+2
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,8 @@ describe('Props can be set properly', () => {
4646
component_name: '',
4747
prop_name: '',
4848
},
49+
persisted_props: ['value'],
50+
persistence_type: 'local',
4951
};
5052
const input = mount(<Input {...defaultProps} />);
5153

tests/unit/RadioItems.test.js

+2
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ describe('Props can be set properly', () => {
2929
component_name: '',
3030
prop_name: '',
3131
},
32+
persisted_props: ['value'],
33+
persistence_type: 'local',
3234
};
3335

3436
const radio = mount(<RadioItems {...testProps} />);

0 commit comments

Comments
 (0)