Skip to content

Commit 6dfda63

Browse files
committed
catch all the errors in the tests
1 parent 2b5411f commit 6dfda63

File tree

8 files changed

+36
-9
lines changed

8 files changed

+36
-9
lines changed

packages/selenium-ide/__mocks__/webextension-polyfill.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ export default {
2020
onMessage: {
2121
addListener: jest.fn(),
2222
},
23-
sendMessage: jest.fn().mockReturnValue(Promise.reject()),
23+
sendMessage: jest.fn().mockReturnValue(Promise.resolve()),
2424
getURL: jest.fn(),
2525
},
2626
}

packages/selenium-ide/src/neo/__test__/components/CommandReference/index.spec.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
// specific language governing permissions and limitations
1616
// under the License.
1717

18+
jest.mock('../../../IO/storage')
1819
import React from 'react'
1920
import { renderIntoDocument, cleanup } from 'react-testing-library'
2021
import CommandReference from '../../../components/CommandReference'

packages/selenium-ide/src/neo/__test__/components/TabBar/index.spec.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
// specific language governing permissions and limitations
1616
// under the License.
1717

18+
jest.mock('../../../IO/storage')
1819
import React from 'react'
1920
import { renderIntoDocument, fireEvent, cleanup } from 'react-testing-library'
2021
import TabBar from '../../../components/TabBar'

packages/selenium-ide/src/neo/__test__/components/TestTable/index.spec.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,18 +15,20 @@
1515
// specific language governing permissions and limitations
1616
// under the License.
1717

18+
jest.mock('../../../IO/storage')
19+
/*
1820
import React from 'react'
1921
import { renderIntoDocument, cleanup } from 'react-testing-library'
2022
import TestTable from '../../../components/TestTable'
2123
import UiState from '../../../stores/view/UiState'
2224
import TestCase from '../../../models/TestCase'
2325
//import CommandTarget from '../../../stores/view/CommandTarget'
24-
26+
*/
2527
describe('<TestTable />', () => {
26-
afterEach(cleanup)
28+
//afterEach(cleanup)
2729

2830
it.skip('renders', () => {
29-
const test = new TestCase()
31+
/*const test = new TestCase()
3032
test.createCommand(undefined, 'a', '', '')
3133
test.createCommand(undefined, 'b', '', '')
3234
test.createCommand(undefined, 'c', '', '')
@@ -39,6 +41,6 @@ describe('<TestTable />', () => {
3941
'.test-table tbody tr.selected'
4042
)
4143
// eslint-disable-next-line
42-
console.log(selectedCommand)
44+
console.log(selectedCommand)*/
4345
})
4446
})

packages/selenium-ide/src/neo/__test__/containers/Console/index.spec.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
// under the License.
1717

1818
jest.mock('../../../IO/storage')
19+
jest.mock('../../../side-effects/playback-logging')
1920
import React from 'react'
2021
import {
2122
cleanup,

packages/selenium-ide/src/neo/components/TestTable/index.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ import classNames from 'classnames'
2424
import UiState from '../../stores/view/UiState'
2525
import PlaybackState from '../../stores/view/PlaybackState'
2626
import TestRow from '../TestRow'
27-
import './style.css'
2827
import { deriveCommandLevels } from '../../playback/playback-tree/command-leveler'
28+
import './style.css'
2929

3030
@observer
3131
export default class TestTable extends React.Component {

packages/selenium-ide/src/neo/containers/Console/index.jsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,17 +17,17 @@
1717

1818
import React from 'react'
1919
import PropTypes from 'prop-types'
20+
import { observe } from 'mobx'
21+
import { observer } from 'mobx-react'
2022
import TabBar from '../../components/TabBar'
2123
import LogList from '../../components/LogList'
2224
import ClearButton from '../../components/ActionButtons/Clear'
2325
import { output } from '../../stores/view/Logs'
2426
import PlaybackLogger from '../../side-effects/playback-logging'
25-
import './style.css'
2627
import CommandReference from '../../components/CommandReference'
2728
import UiState from '../../stores/view/UiState'
28-
import { observer } from 'mobx-react'
29-
import { observe } from 'mobx'
3029
import { Commands } from '../../models/Command'
30+
import './style.css'
3131

3232
@observer
3333
export default class Console extends React.Component {
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
// Licensed to the Software Freedom Conservancy (SFC) under one
2+
// or more contributor license agreements. See the NOTICE file
3+
// distributed with this work for additional information
4+
// regarding copyright ownership. The SFC licenses this file
5+
// to you under the Apache License, Version 2.0 (the
6+
// "License"); you may not use this file except in compliance
7+
// with the License. You may obtain a copy of the License at
8+
//
9+
// http://www.apache.org/licenses/LICENSE-2.0
10+
//
11+
// Unless required by applicable law or agreed to in writing,
12+
// software distributed under the License is distributed on an
13+
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
// KIND, either express or implied. See the License for the
15+
// specific language governing permissions and limitations
16+
// under the License.
17+
18+
export default class PlaybackLogger {
19+
dispose() {
20+
return jest.fn()
21+
}
22+
}

0 commit comments

Comments
 (0)