| Total Complexity | 4 |
| Complexity/F | 0 |
| Lines of Code | 23 |
| Function Count | 0 |
| Duplicated Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | import ClosePollFormCard from '../../src/cards/ClosePollFormCard'; |
||
| 2 | import {dummyAnonymousPollState, dummyAutoclosePollState, dummyLocalTimezone} from '../dummy'; |
||
| 3 | |||
| 4 | it('should return a schedule time info when the poll has auto schedule time ', |
||
| 5 | () => { |
||
| 6 | const closePollFormCard = new ClosePollFormCard(dummyAutoclosePollState, dummyLocalTimezone); |
||
| 7 | const result = closePollFormCard.create(); |
||
| 8 | expect(result).toHaveProperty('header'); |
||
| 9 | expect(result).toHaveProperty('sections'); |
||
| 10 | // expect(result.sections).toMatchObject({'knownIcon':'CLOCK'}); |
||
| 11 | expect(result.sections!.find((section) => section.widgets?.[0]?.decoratedText?.startIcon?.knownIcon === 'CLOCK')). |
||
| 12 | toBeDefined(); |
||
| 13 | }); |
||
| 14 | it('should return a valid CardWithId object with cardId and card properties when createCardWithId method is called', |
||
| 15 | () => { |
||
| 16 | const closePollFormCard = new ClosePollFormCard(dummyAnonymousPollState, dummyLocalTimezone); |
||
| 17 | const result = closePollFormCard.createCardWithId(); |
||
| 18 | expect(result).toEqual({ |
||
| 19 | 'cardId': 'close_poll_form', |
||
| 20 | 'card': closePollFormCard.create(), |
||
| 21 | }); |
||
| 22 | }); |
||
| 23 |