Skip to content

Commit e7643b9

Browse files
committed
passing diff.test
1 parent dc66fbd commit e7643b9

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

src/app/__tests__/Diff.test.jsx

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,9 @@ describe('Unit testing for Diff.jsx', () => {
2929

3030
useStoreContext.mockImplementation(() => [state]);
3131

32-
const delta = { children: {} }; // expect delta to be an obj
32+
let delta = { children: {} }; // expect delta to be an obj
3333
const html = 'html'; // expect html to be a string
34-
const previous = { state: 'string', children: {} }; // expect previous to be an obj
34+
let previous = { state: 'string', children: {} }; // expect previous to be an obj
3535

3636
beforeEach(() => {
3737
wrapper = shallow(<Diff {...props} />);
@@ -65,9 +65,8 @@ describe('Unit testing for Diff.jsx', () => {
6565
it('Check if Diff component inner text value is a string', () => {
6666
expect(typeof wrapper.text()).toEqual('string');
6767
});
68-
xit('Check if Diff component div has a className noState ', () => {
69-
console.log(wrapper.props());
70-
expect(wrapper.props().className).toEqual('noState');
68+
it('Check if previous and delta is defined Diff should not have text content "No state change detected. Trigger an event to change state"', () => {
69+
expect(wrapper.textContent).not.toEqual('No state change detected. Trigger an event to change state');
7170
});
7271
});
7372

0 commit comments

Comments
 (0)