Skip to content

Commit

Permalink
TEMPORARY COMMIT
Browse files Browse the repository at this point in the history
  • Loading branch information
marcopagliarulo committed Apr 29, 2023
1 parent 57cbea5 commit f626dcf
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 21 deletions.
17 changes: 9 additions & 8 deletions packages/bodiless-core/__tests__/contextMenuForm.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -76,31 +76,31 @@ describe('ContextMenuForm', () => {
{() => <></>}
</ContextMenuForm>
);
it.skip('Closes the form when the submit handler returns nothing', () => {
it('Closes the form when the submit handler returns nothing', () => {
const wrapper = shallow(jsx);
wrapper.prop('onSubmit')();
wrapper.prop('onSubmit')({values: {}});
expect(close).toHaveBeenCalled();
});
it.skip('Does not close the form when the submit handler returns true', () => {
it('Does not close the form when the submit handler returns true', () => {
submit.mockReturnValueOnce(true);
close.mockReset();
const wrapper = shallow(
(<ContextMenuForm closeForm={close}>{() => <></>}</ContextMenuForm>),
);
wrapper.prop('onSubmit')();
wrapper.prop('onSubmit')({values: {}});
expect(close).toHaveBeenCalled();
});
it.skip('Closes the form when no submit handler is provided', () => {
it('Closes the form when no submit handler is provided', () => {
close.mockReset();
const wrapper = shallow(jsx);
wrapper.prop('onSubmit')();
wrapper.prop('onSubmit')({values: {}});
expect(close).not.toHaveBeenCalled();
});
});
});

describe('ContextMenuForm (High Level)', () => {
it.skip('Allows state from an enclosing component to be used in the form and submit handler', () => {
it('Allows state from an enclosing component to be used in the form and submit handler', () => {
const submit = jest.fn();
const close = jest.fn();
const Form = (props: ContextMenuFormProps) => {
Expand All @@ -116,9 +116,10 @@ describe('ContextMenuForm (High Level)', () => {
);
};
const wrapper = mount(<Form closeForm={close} />);
const stateButton = wrapper.find('button#clickme');
let stateButton = wrapper.find('button#clickme');
expect(stateButton.text()).toBe('unclicked');
stateButton.simulate('click');
stateButton = wrapper.find('button#clickme');
expect(stateButton.text()).toBe('clicked');
const submitButton = wrapper.find('button[aria-label="Submit"]');
submitButton.simulate('submit');
Expand Down
2 changes: 1 addition & 1 deletion packages/bodiless-git/__tests__/commits-list.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ const mockedClient = {
};

describe('CommitsList component', () => {
it.skip('should show a spinner while a request to the back-end is processed', () => {
it('should show a spinner while a request to the back-end is processed', () => {
const wrapper = mount(<CommitsList client={mockedClient} />);
expect(wrapper!.find('.bodiless-spinner').length > 0).toBe(true);
});
Expand Down
25 changes: 13 additions & 12 deletions packages/bodiless-git/__tests__/remote-changes.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
import React from 'react';
// eslint-disable-next-line import/no-extraneous-dependencies
import { mount } from 'enzyme';
import { act } from 'react-test-renderer';
import {
FetchChanges,
PullChanges,
Expand Down Expand Up @@ -92,19 +93,19 @@ const nonPullableChangesClient = mockClient({
});

describe('Fetch Changes component', () => {
it.skip('should detect changes are not available', async () => {
const wrapper = mount(
<FetchChanges
client={noChangesClient}
formApi={mockFormApi}
notifyOfChanges={jest.fn()}
ui={{}}
/>,
);
return new Promise(resolve => setImmediate(resolve)).then(() => {
wrapper.update();
expect(wrapper.text()).toBe('No changes are available, your Edit Environment is up to date!');
it('should detect changes are not available', async () => {
let wrapper;
await act(async () => {
wrapper = mount(
<FetchChanges
client={noChangesClient}
formApi={mockFormApi}
notifyOfChanges={jest.fn()}
ui={{}}
/>,
);
});
expect(wrapper.text()).toBe('No changes are available, your Edit Environment is up to date!');
});

it.skip('should indicate changes to download if upstream changes', async () => {
Expand Down

0 comments on commit f626dcf

Please sign in to comment.