Skip to content

Commit

Permalink
Tests
Browse files Browse the repository at this point in the history
Signed-off-by: Alberto Gutierrez <aljesusg@gmail.com>
  • Loading branch information
aljesusg committed Nov 22, 2018
1 parent 8f1bf1d commit 3e7ccd7
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.

import queryString from 'query-string';

jest.mock('redux-form', () => {
function reduxForm() {
return component => component;
Expand Down Expand Up @@ -81,6 +83,12 @@ describe('<SearchTracePage>', () => {
store.get = oldFn;
});

it('return the searchpath if call getSearchURL', () => {
const query = "end=1542906238737000&limit=20&lookback=1h&maxDuration&minDuration&service=productpage&start=1542902638737000"
wrapper = mount(<SearchTracePage {...props} query={query}/>);
expect(wrapper.instance().getSearchURL()).toBe(`/search?${queryString.stringify(query)}`);
});

it('shows a loading indicator if loading services', () => {
wrapper.setProps({ loadingServices: true });
expect(wrapper.find(LoadingIndicator).length).toBe(1);
Expand Down

0 comments on commit 3e7ccd7

Please sign in to comment.