Skip to content

Commit 3572631

Browse files
committed
fixing tests
1 parent ed8f4f8 commit 3572631

File tree

3 files changed

+8
-6
lines changed

3 files changed

+8
-6
lines changed

src/components/contractors/List.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ export const List = ({contractors, root}) => (
4040
<div className="tcs-list">
4141
{contractors.map((contractor, i) => (
4242
<AnimateLink key={i} delay={i * 80} to={root.url(contractor.link)} className="tcs-item">
43-
<div className="tcs-image-col tcs-box">
43+
<div className="tcs-image-col">
4444
<img src={contractor.photo} alt={contractor.name} className="tcs-thumb"/>
4545
<button className="tcs-button">
4646
{root.get_text('view_profile')}

src/tests/App.test.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ it('shows tutors', async () => {
1212
router_mode: 'history',
1313
api_root: 'https://socket.tutorcruncher.com',
1414
mode: 'grid',
15+
messages: {no_tutors_found: 'xx'},
1516
event_callback: () => null,
1617
}
1718
const wrapper = enz.mount(<Router><App config={config} public_key={'good'} url_generator={u => u}/></Router>)
@@ -22,16 +23,17 @@ it('shows tutors', async () => {
2223
expect(xhr_calls[1]).toEqual({
2324
method: 'GET',
2425
url: 'https://socket.tutorcruncher.com/good/contractors',
25-
args: null
26+
args: 'page=1'
2627
})
27-
expect(wrapper.find('.tcs-col').length).toBe(2)
28+
expect(wrapper.find('.tcs-item').length).toBe(2)
2829
})
2930

3031
it('with con filter', async () => {
3132
const config = {
3233
router_mode: 'history',
3334
api_root: 'https://socket.tutorcruncher.com',
3435
mode: 'grid',
36+
messages: {no_tutors_found: 'xx'},
3537
contractor_filter: {
3638
label: ['foobar'],
3739
label_exclude: ['spam'],
@@ -45,7 +47,7 @@ it('with con filter', async () => {
4547
expect(xhr_calls[1]).toEqual({
4648
method: 'GET',
4749
url: 'https://socket.tutorcruncher.com/good/contractors',
48-
args: 'label=foobar&label_exclude=spam'
50+
args: 'label=foobar&label_exclude=spam&page=1'
4951
})
50-
expect(wrapper.find('.tcs-col').length).toBe(2)
52+
expect(wrapper.find('.tcs-item').length).toBe(2)
5153
})

src/tests/utils.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ function MockXMLHttpRequest () {
7878
}
7979

8080
export function tick () {
81-
return new Promise(resolve => setTimeout(resolve, 0))
81+
return new Promise(resolve => setTimeout(resolve, 50))
8282
}
8383

8484
export function xhr_setup () {

0 commit comments

Comments
 (0)