Пример #1
0
 it('is not a match with different props', () => {
   const message = new Message('error', { ...fakeData });
   const other = new Message('error', {
     ...fakeData,
     message: 'different message',
   });
   expect(message.matches(other)).toBeFalsy();
 });
Пример #2
0
 it('is not a match with props the same except type', () => {
   const message = new Message('error', { ...fakeData });
   const other = new Message('warning', { ...fakeData });
   expect(message.matches(other)).toBeFalsy();
 });
Пример #3
0
 it('is a match if the props are all the same', () => {
   const message = new Message('error', { ...fakeData });
   const other = new Message('error', { ...fakeData });
   expect(message.matches(other)).toBeTruthy();
 });