Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
it('renders correctly', () => {
const props = {
routeStops: [{
stop_id: '1',
stop_lat: 12,
stop_lon: 34,
stop_name: 'mock gtfs stop'
}],
selectStops: jest.fn()
}
// mount component
const tree = renderer
.create(
<map>
</map>
)
.toJSON()
expect(tree).toMatchSnapshot()
const noCalls = ['selectStops']
noCalls.forEach(fn => {
expect(props[fn]).not.toBeCalled()
})
})
})
test('SyntaxHighlighter renders childre unadultered when no language disocvered in highlight auto', () => {
const tree = renderer
.create(
{`Contacts* contacts = [[Contacts alloc]init];`}
)
.toJSON();
expect(tree).toMatchSnapshot();
});
it('renders correctly', () => {
const tree = renderer.create(
);
});
test('StatusInterceptor should display the proper message for 401 errors', () => {
const statusCode = 401;
const component = renderer.create();
const tree = component.toJSON();
expect(tree).toMatchSnapshot();
});
it('renders correctly with all required props', () => {
const tree = renderer.create().toJSON();
expect(tree).toMatchSnapshot();
});
it('renders correctly', () => {
const tree = renderer.create(
);
});
expect(() => renderer.create()).toThrow();
});
export async function mount(
element: Element,
children: (renderer: ReactTestRenderer) => Promise
) {
expect.hasAssertions();
const renderer = create(element);
try {
await children(renderer);
} finally {
renderer.unmount();
}
}
.subtract(1, "year")
.toISOString(),
body: messageBody,
is_from_user: true,
attachments: [],
from: {
name: "Percy",
email: "percy@cat.com",
},
invoice: {
state: "UNPAID",
total: "$420",
payment_url: "https://www.adopt-cats.org/pay-here",
},
}
const tree = renderer
.create(
)
.toJSON()
expect(tree).toMatchSnapshot()
})
function render(props) {
return TestRenderer.create();
}