mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 01:38:56 -04:00
[Uptime] Fixed failing unit test because of timestamp in snapshot (#52302)
* fixed test * update snaps
This commit is contained in:
parent
9f024b8067
commit
931cf220c9
2 changed files with 7 additions and 2 deletions
|
@ -1,6 +1,6 @@
|
|||
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
||||
|
||||
exports[`MostRecentError component renders properly with empty data 1`] = `
|
||||
exports[`MostRecentError component renders properly with mock data 1`] = `
|
||||
Array [
|
||||
<div
|
||||
class="euiText euiText--extraSmall"
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
|
||||
import { shallowWithIntl, renderWithIntl } from 'test_utils/enzyme_helpers';
|
||||
import React from 'react';
|
||||
import moment from 'moment';
|
||||
import { BrowserRouter as Router } from 'react-router-dom';
|
||||
import { MostRecentError } from '../most_recent_error';
|
||||
import { MonitorDetails, MonitorError } from '../../../../../../common/runtime_types';
|
||||
|
@ -14,6 +15,10 @@ describe('MostRecentError component', () => {
|
|||
let monitorDetails: MonitorDetails;
|
||||
let monitorError: MonitorError;
|
||||
|
||||
beforeAll(() => {
|
||||
moment.prototype.fromNow = jest.fn(() => '5 days ago');
|
||||
});
|
||||
|
||||
beforeEach(() => {
|
||||
monitorError = {
|
||||
type: 'io',
|
||||
|
@ -39,7 +44,7 @@ describe('MostRecentError component', () => {
|
|||
expect(component).toMatchSnapshot();
|
||||
});
|
||||
|
||||
it.skip('renders properly with empty data', () => {
|
||||
it('renders properly with mock data', () => {
|
||||
const component = renderWithIntl(
|
||||
<Router>
|
||||
<MostRecentError
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue