Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bumping enzyme to latest version #1055

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/frontend/components/__tests__/actionItem.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ const defaultTestProps: ActionItemProps = {

describe("Action Item component", () => {
it("renders correctly when there are no action items.", () => {
const wrapper = shallow(<ActionItem {...defaultTestProps} />);
const wrapper = shallow(<ActionItem {...defaultTestProps} /> as any);
const component = wrapper.children().dive();
expect(toJson(component)).toMatchSnapshot();
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ const defaultTestProps: ActionItemDisplayProps = {

describe("Action Item Display component", () => {
it("renders correctly when there are no action items.", () => {
const wrapper = shallow(<ActionItemDisplay {...defaultTestProps} />);
const wrapper = shallow(<ActionItemDisplay {...defaultTestProps} /> as any);
const component = wrapper.children().dive();
expect(toJson(component)).toMatchSnapshot();
});
Expand Down
8 changes: 4 additions & 4 deletions src/frontend/components/__tests__/boardSummary.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ const mockedWorkItemCountProps: IBoardSummaryProps = {

describe('Board Summary', () => {
it('renders with no action or work items.', () => {
const wrapper = shallow(<BoardSummary {...mockedDefaultProps} />);
const wrapper = shallow(<BoardSummary {...mockedDefaultProps} /> as any);
const component = wrapper.children().dive();

verifySummaryBoardCounts(component, mockedDefaultProps);
Expand All @@ -34,15 +34,15 @@ describe('Board Summary', () => {
it('renders with one action item.', () => {
mockedDefaultProps.actionItems.push(mockWorkItem);
mockedDefaultProps.supportedWorkItemTypes.push(mockWorkItemType);
const wrapper = shallow(<BoardSummary {...mockedDefaultProps} />);
const wrapper = shallow(<BoardSummary {...mockedDefaultProps} /> as any);
const component = wrapper.children().dive();

verifySummaryBoardCounts(component, mockedDefaultProps);
verifyActionItemsSummaryCard(component, true);
});

it('renders when work item counts are greater than zero.', () => {
const wrapper = shallow(<BoardSummary {...mockedWorkItemCountProps} />);
const wrapper = shallow(<BoardSummary {...mockedWorkItemCountProps} /> as any);
const component = wrapper.children().dive();

verifySummaryBoardCounts(component, mockedWorkItemCountProps);
Expand All @@ -52,7 +52,7 @@ describe('Board Summary', () => {
it('renders with one action item when work item counts are greater than zero.', () => {
mockedWorkItemCountProps.actionItems.push(mockWorkItem);
mockedWorkItemCountProps.supportedWorkItemTypes.push(mockWorkItemType);
const wrapper = shallow(<BoardSummary {...mockedWorkItemCountProps} />);
const wrapper = shallow(<BoardSummary {...mockedWorkItemCountProps} /> as any);
const component = wrapper.children().dive();

verifySummaryBoardCounts(component, mockedWorkItemCountProps);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const mockedProps = mocked({
describe('Editable Document Card Title ', () => {
it('can be rendered when enabled.', () => {
mockedProps.isDisabled = true;
const wrapper = shallow(<EditableDocumentCardTitle {...mockedProps} />);
const wrapper = shallow(<EditableDocumentCardTitle {...mockedProps} /> as any);
const component = wrapper.children().dive();

expect(component.prop('className')).toBe('editable-document-card-title');
Expand Down
4 changes: 2 additions & 2 deletions src/frontend/components/__tests__/editableText.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@ const mockedTestProps: EditableTextProps = {

describe('Editable Text Component', () => {
it('renders correctly.', () => {
const wrapper = shallow(<EditableText {...mockedTestProps} />);
const wrapper = shallow(<EditableText {...mockedTestProps} /> as any);
const component = wrapper.children().dive();
expect(toJson(component)).toMatchSnapshot();
});

it('updates text appropriately.', () => {
mockedTestProps.text = 'Test Text';

const wrapper = shallow(<EditableText {...mockedTestProps} />);
const wrapper = shallow(<EditableText {...mockedTestProps} /> as any);
const component = wrapper.children().dive();
expect(toJson(component)).toMatchSnapshot();
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ const feedbackBoardContainerProps: FeedbackBoardContainerProps = {

describe('Feedback Board Container ', () => {
it('can be rendered without content.', () => {
const wrapper = shallow(<FeedbackBoardContainer {...feedbackBoardContainerProps} />);
const wrapper = shallow(<FeedbackBoardContainer {...feedbackBoardContainerProps} /> as any);
expect(wrapper.children().dive().html()).toBe(
'<div class="ms-Spinner initialization-spinner root-53"><div class="ms-Spinner-circle ms-Spinner--large circle-54">' +
'</div><div class="ms-Spinner-label label-55">Loading...</div></div>');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jest.mock('uuid', () => ({ v4: () => mockUuid}));

describe('Board Metadata Form', () => {
it('can be rendered', () => {
const wrapper = shallow(<FeedbackBoardMetadataForm {...mockedProps} />);
const wrapper = shallow(<FeedbackBoardMetadataForm {...mockedProps} /> as any);
const component = wrapper.children().dive();
const textField = component.findWhere(c => c.prop('id') === 'retrospective-title-input').find(TextField);

Expand All @@ -36,7 +36,7 @@ describe('Board Metadata Form', () => {
})

it('should set the title to nothing', () => {
const wrapper = shallow(<FeedbackBoardMetadataForm {...mockedProps} />);
const wrapper = shallow(<FeedbackBoardMetadataForm {...mockedProps} /> as any);
const component = wrapper.children().dive();
const textField = component.findWhere(c => c.prop('id') === 'retrospective-title-input').find(TextField);

Expand All @@ -45,7 +45,7 @@ describe('Board Metadata Form', () => {
});

it('should properly set max votes settings', () => {
const wrapper = shallow(<FeedbackBoardMetadataForm {...mockedProps} />);
const wrapper = shallow(<FeedbackBoardMetadataForm {...mockedProps} /> as any);
const component = wrapper.children().dive();
const textField = component.findWhere(c => c.prop('id') === 'max-vote-counter').find(TextField);

Expand All @@ -54,7 +54,7 @@ describe('Board Metadata Form', () => {
});

it('should properly set include team assessment settings', () => {
const wrapper = shallow(<FeedbackBoardMetadataForm {...mockedProps} />);
const wrapper = shallow(<FeedbackBoardMetadataForm {...mockedProps} /> as any);
const component = wrapper.children().dive();
const checkbox = component.findWhere(c => c.prop('id') === 'include-team-assessment-checkbox').find(Checkbox);

Expand All @@ -64,7 +64,7 @@ describe('Board Metadata Form', () => {
});

it('should properly set obscure feedback settings', () => {
const wrapper = shallow(<FeedbackBoardMetadataForm {...mockedProps} />);
const wrapper = shallow(<FeedbackBoardMetadataForm {...mockedProps} /> as any);
const component = wrapper.children().dive();
const checkbox = component.findWhere(c => c.prop('id') === 'obscure-feedback-checkbox').find(Checkbox);

Expand All @@ -74,7 +74,7 @@ describe('Board Metadata Form', () => {
});

it('should properly set prime directive setting', () => {
const wrapper = shallow(<FeedbackBoardMetadataForm {...mockedProps} />);
const wrapper = shallow(<FeedbackBoardMetadataForm {...mockedProps} /> as any);
const component = wrapper.children().dive();
const checkbox = component.findWhere(c => c.prop('id') === 'display-prime-directive').find(Checkbox);

Expand All @@ -84,7 +84,7 @@ describe('Board Metadata Form', () => {
});

it('should properly set display names settings', () => {
const wrapper = shallow(<FeedbackBoardMetadataForm {...mockedProps} />);
const wrapper = shallow(<FeedbackBoardMetadataForm {...mockedProps} /> as any);
const component = wrapper.children().dive();
const checkbox = component.findWhere(c => c.prop('id') === 'feedback-display-names-checkbox').find(Checkbox);

Expand All @@ -94,7 +94,7 @@ describe('Board Metadata Form', () => {
});

it('should properly set the column list', () => {
const wrapper = shallow(<FeedbackBoardMetadataForm {...mockedProps} />);
const wrapper = shallow(<FeedbackBoardMetadataForm {...mockedProps} /> as any);
const component = wrapper.children().dive();
const list = component.find(List).first();

Expand All @@ -115,7 +115,7 @@ describe('Board Metadata Form', () => {
})

it('should set the title', () => {
const wrapper = shallow(<FeedbackBoardMetadataForm {...mockedProps} />);
const wrapper = shallow(<FeedbackBoardMetadataForm {...mockedProps} /> as any);
const component = wrapper.children().dive();
const textField = component.findWhere(c => c.prop('id') === 'retrospective-title-input').find(TextField);

Expand All @@ -124,7 +124,7 @@ describe('Board Metadata Form', () => {
});

it('should properly set max votes settings', () => {
const wrapper = shallow(<FeedbackBoardMetadataForm {...mockedProps} />);
const wrapper = shallow(<FeedbackBoardMetadataForm {...mockedProps} /> as any);
const component = wrapper.children().dive();
const textField = component.findWhere(c => c.prop('id') === 'max-vote-counter').find(TextField);

Expand All @@ -133,7 +133,7 @@ describe('Board Metadata Form', () => {
});

it('should properly set include team assessment settings', () => {
const wrapper = shallow(<FeedbackBoardMetadataForm {...mockedProps} />);
const wrapper = shallow(<FeedbackBoardMetadataForm {...mockedProps} /> as any);
const component = wrapper.children().dive();
const checkbox = component.findWhere(c => c.prop('id') === 'include-team-assessment-checkbox').find(Checkbox);

Expand All @@ -143,7 +143,7 @@ describe('Board Metadata Form', () => {
});

it('should properly set obscure feedback settings', () => {
const wrapper = shallow(<FeedbackBoardMetadataForm {...mockedProps} />);
const wrapper = shallow(<FeedbackBoardMetadataForm {...mockedProps} /> as any);
const component = wrapper.children().dive();
const checkbox = component.findWhere(c => c.prop('id') === 'obscure-feedback-checkbox').find(Checkbox);

Expand All @@ -153,7 +153,7 @@ describe('Board Metadata Form', () => {
});

it('should properly set prime directive setting', () => {
const wrapper = shallow(<FeedbackBoardMetadataForm {...mockedProps} />);
const wrapper = shallow(<FeedbackBoardMetadataForm {...mockedProps} /> as any);
const component = wrapper.children().dive();
const checkbox = component.findWhere(c => c.prop('id') === 'display-prime-directive').find(Checkbox);

Expand All @@ -163,7 +163,7 @@ describe('Board Metadata Form', () => {
});

it('should properly set display names settings', () => {
const wrapper = shallow(<FeedbackBoardMetadataForm {...mockedProps} />);
const wrapper = shallow(<FeedbackBoardMetadataForm {...mockedProps} /> as any);
const component = wrapper.children().dive();
const checkbox = component.findWhere(c => c.prop('id') === 'feedback-display-names-checkbox').find(Checkbox);

Expand All @@ -173,7 +173,7 @@ describe('Board Metadata Form', () => {
});

it('should properly set the column list', () => {
const wrapper = shallow(<FeedbackBoardMetadataForm {...mockedProps} />);
const wrapper = shallow(<FeedbackBoardMetadataForm {...mockedProps} /> as any);
const component = wrapper.children().dive();
const list = component.find(List).first();

Expand All @@ -195,7 +195,7 @@ describe('Board Metadata Form', () => {
})

it('should set the title with the duplicate copy addition', () => {
const wrapper = shallow(<FeedbackBoardMetadataForm {...mockedProps} />);
const wrapper = shallow(<FeedbackBoardMetadataForm {...mockedProps} /> as any);
const component = wrapper.children().dive();
const textField = component.findWhere(c => c.prop('id') === 'retrospective-title-input').find(TextField);

Expand All @@ -204,7 +204,7 @@ describe('Board Metadata Form', () => {
});

it('should properly set max votes settings', () => {
const wrapper = shallow(<FeedbackBoardMetadataForm {...mockedProps} />);
const wrapper = shallow(<FeedbackBoardMetadataForm {...mockedProps} /> as any);
const component = wrapper.children().dive();
const textField = component.findWhere(c => c.prop('id') === 'max-vote-counter').find(TextField);

Expand All @@ -213,7 +213,7 @@ describe('Board Metadata Form', () => {
});

it('should properly set include team assessment settings', () => {
const wrapper = shallow(<FeedbackBoardMetadataForm {...mockedProps} />);
const wrapper = shallow(<FeedbackBoardMetadataForm {...mockedProps} /> as any);
const component = wrapper.children().dive();
const checkbox = component.findWhere(c => c.prop('id') === 'include-team-assessment-checkbox').find(Checkbox);

Expand All @@ -223,7 +223,7 @@ describe('Board Metadata Form', () => {
});

it('should properly set obscure feedback settings', () => {
const wrapper = shallow(<FeedbackBoardMetadataForm {...mockedProps} />);
const wrapper = shallow(<FeedbackBoardMetadataForm {...mockedProps} /> as any);
const component = wrapper.children().dive();
const checkbox = component.findWhere(c => c.prop('id') === 'obscure-feedback-checkbox').find(Checkbox);

Expand All @@ -233,7 +233,7 @@ describe('Board Metadata Form', () => {
});

it('should properly set prime directive setting', () => {
const wrapper = shallow(<FeedbackBoardMetadataForm {...mockedProps} />);
const wrapper = shallow(<FeedbackBoardMetadataForm {...mockedProps} /> as any);
const component = wrapper.children().dive();
const checkbox = component.findWhere(c => c.prop('id') === 'display-prime-directive').find(Checkbox);

Expand All @@ -243,7 +243,7 @@ describe('Board Metadata Form', () => {
});

it('should properly set display names settings', () => {
const wrapper = shallow(<FeedbackBoardMetadataForm {...mockedProps} />);
const wrapper = shallow(<FeedbackBoardMetadataForm {...mockedProps} /> as any);
const component = wrapper.children().dive();
const checkbox = component.findWhere(c => c.prop('id') === 'feedback-display-names-checkbox').find(Checkbox);

Expand All @@ -253,7 +253,7 @@ describe('Board Metadata Form', () => {
});

it('should properly set the column list', () => {
const wrapper = shallow(<FeedbackBoardMetadataForm {...mockedProps} />);
const wrapper = shallow(<FeedbackBoardMetadataForm {...mockedProps} /> as any);
const component = wrapper.children().dive();
const list = component.find(List).first();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ describe('Board Metadata Form Permissions', () => {
});

it('can be rendered', () => {
const wrapper = shallow(<FeedbackBoardMetadataFormPermissions {...mockedProps} />);
const wrapper = shallow(<FeedbackBoardMetadataFormPermissions {...mockedProps} /> as any);
const component = wrapper.children().dive();
const textField = component.findWhere(c => c.prop('id') === 'retrospective-permission-search-input').find(TextField);

Expand All @@ -36,7 +36,7 @@ describe('Board Metadata Form Permissions', () => {
const publicBannerText: string = 'This board is visible to every member in the organization.';

it('should show when there are not team or member permissions', () => {
const wrapper = shallow(<FeedbackBoardMetadataFormPermissions {...mockedProps} />);
const wrapper = shallow(<FeedbackBoardMetadataFormPermissions {...mockedProps} /> as any);
const component = wrapper.children().dive();
const element = component.findWhere(c => c.text() === publicBannerText);

Expand All @@ -51,7 +51,7 @@ describe('Board Metadata Form Permissions', () => {
Members: [] as string[]
}
};
const wrapper = shallow(<FeedbackBoardMetadataFormPermissions {...props} />);
const wrapper = shallow(<FeedbackBoardMetadataFormPermissions {...props} /> as any);
const component = wrapper.children().dive();
const element = component.findWhere(c => c.text() === publicBannerText);

Expand All @@ -66,7 +66,7 @@ describe('Board Metadata Form Permissions', () => {
Members: [testUserId]
}
};
const wrapper = shallow(<FeedbackBoardMetadataFormPermissions {...props} />);
const wrapper = shallow(<FeedbackBoardMetadataFormPermissions {...props} /> as any);
const component = wrapper.children().dive();
const element = component.findWhere(c => c.text() === publicBannerText);

Expand Down Expand Up @@ -96,7 +96,7 @@ describe('Board Metadata Form Permissions', () => {
}
]
};
const wrapper = shallow(<FeedbackBoardMetadataFormPermissions {...props} />);
const wrapper = shallow(<FeedbackBoardMetadataFormPermissions {...props} /> as any);
const component = wrapper.children().dive();
const tableBody = component.find('tbody');
const tableRows = tableBody.find('tr');
Expand Down Expand Up @@ -127,7 +127,7 @@ describe('Board Metadata Form Permissions', () => {
}
]
};
const wrapper = shallow(<FeedbackBoardMetadataFormPermissions {...props} />);
const wrapper = shallow(<FeedbackBoardMetadataFormPermissions {...props} /> as any);
const component = wrapper.children().dive();
const tableBody = component.find('tbody');
const tableRows = tableBody.find('tr');
Expand Down Expand Up @@ -165,7 +165,7 @@ describe('Board Metadata Form Permissions', () => {
},
]
};
const wrapper = mount(<FeedbackBoardMetadataFormPermissions {...props} />);
const wrapper = mount(<FeedbackBoardMetadataFormPermissions {...props} /> as any);
const tableBody = wrapper.find('tbody');
const tableRows = tableBody.find('tr');

Expand Down Expand Up @@ -216,7 +216,7 @@ describe('Board Metadata Form Permissions', () => {
},
]
};
const wrapper = mount(<FeedbackBoardMetadataFormPermissions {...props} />);
const wrapper = mount(<FeedbackBoardMetadataFormPermissions {...props} /> as any);
const tableBody = wrapper.find('tbody');
const tableRows = tableBody.find('tr');

Expand Down Expand Up @@ -274,7 +274,7 @@ describe('Board Metadata Form Permissions', () => {
},
]
};
const wrapper = mount(<FeedbackBoardMetadataFormPermissions {...props} />);
const wrapper = mount(<FeedbackBoardMetadataFormPermissions {...props} /> as any);
const tableBody = wrapper.find('tbody');
const tableRows = tableBody.find('tr');

Expand Down
Loading
Loading