Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
it("can cancel a call", () => {
const hangUpCurrentCallAction = jest.fn();
const phoneNumber = "123456";
const caller = "John Doe";
const phoneService = {
hangUpCurrentCallAction: hangUpCurrentCallAction
};
const wrapper = shallow(
key}
/>
);
const div = wrapper.find(".HangupButton");
div.simulate("click");
expect(hangUpCurrentCallAction).toHaveBeenCalled();
});
});
it('Render Search Component', () => {
const search = shallow();
expect(search.exists()).toBeTruthy();
});
});
it('Test Render Result component', () => {
const experimentResultComponent = shallow(
,
);
expect(experimentResultComponent.exists()).toBeTruthy();
const datasetResultComponent = shallow(
,
);
expect(datasetResultComponent.exists()).toBeTruthy();
const datafileResultComponent = shallow(
,
);
expect(datafileResultComponent.exists()).toBeTruthy();
});
it('Test Render Simple Search Form', () => {
it('Render Results Component', () => {
const data = JSON.parse(apiResponse);
expect(data).toBeTruthy();
let newResults = [];
newResults = createExperimentResultData(data.objects[0].hits.experiments, newResults);
expect(newResults).toBeTruthy();
newResults = createDatasetResultData(data.objects[0].hits.datasets, newResults);
expect(newResults).toBeTruthy();
newResults = createDataFileResultData(data.objects[0].hits.datafiles, newResults);
expect(newResults).toBeTruthy();
const _counts = {
experimentsCount: 0,
datasetsCount: 0,
datafilesCount: 0,
};
const results = shallow();
expect(results).toBeTruthy();
});
});
it('Test Render Result component', () => {
const experimentResultComponent = shallow(
,
);
expect(experimentResultComponent.exists()).toBeTruthy();
const datasetResultComponent = shallow(
,
);
expect(datasetResultComponent.exists()).toBeTruthy();
const datafileResultComponent = shallow(
,
);
expect(datafileResultComponent.exists()).toBeTruthy();
});
it('Test Render Simple Search Form', () => {
it('Test Render Result component', () => {
const experimentResultComponent = shallow(
,
);
expect(experimentResultComponent.exists()).toBeTruthy();
const datasetResultComponent = shallow(
,
);
expect(datasetResultComponent.exists()).toBeTruthy();
const datafileResultComponent = shallow(
,
);
expect(datafileResultComponent.exists()).toBeTruthy();
});
it('Test Render Simple Search Form', () => {
it('Test Render Simple Search Form', () => {
const simpleSearchForm = shallow();
expect(simpleSearchForm).toBeTruthy();
});
it('Test Render Advanced Search Form', () => {
it("contains Texts", () => {
const phoneNumber = "123456";
const caller = "John Doe";
const wrapper = shallow(
key}
/>
);
expect(wrapper.debug()).toContain("ModalContent");
expect(wrapper.debug()).toContain("callingText");
expect(wrapper.debug()).toContain("phone");
expect(wrapper.debug()).toContain(phoneNumber);
expect(wrapper.debug()).toContain(caller);
});
it('should slide to next by button click', () => {
const onPress = jest.fn();
const component = shallow(
);
const next = component.instance()._renderNext();
next.props.onPress();
expect(onPress).toHaveBeenCalled();
});
it('Test Render Advanced Search Form', () => {
const advanceSearchForm = shallow(
,
);
expect(advanceSearchForm).toBeTruthy();
});
});