Skip to content

Commit

Permalink
test(Calendar): remove unnecessary onMonthChange screenshot
Browse files Browse the repository at this point in the history
  • Loading branch information
zhzz committed Apr 27, 2024
1 parent 0e46eb9 commit b758964
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 62 deletions.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -156,59 +156,3 @@ CalendarWithCustomCellSize.parameters = {
},
},
};

export const CalendarWithMonthChangeHandle: Story = () => {
const [month, setMonth] = useState(12);
const [year, setYear] = useState(2017);
const [value, setValue] = useState('02.12.2017');

const onStuckMonth = (changeInfo: CalendarMonthInfo): void => {
setMonth(changeInfo.month);
setYear(changeInfo.year);
};

const containerWithInfoStyle: CSSProperties = {
display: 'flex',
justifyContent: 'space-between',
fontSize: '18px',
marginLeft: '64px',
width: '450px',
textAlign: 'center',
};
const containersStyle: CSSProperties = { display: 'flex', flexDirection: 'column' };
const monthYearStyle: CSSProperties = { border: '1px #c2b8b8 solid' };

return (
<div style={{ display: 'flex' }}>
<Calendar value={value} onValueChange={setValue} onStuckMonth={onStuckMonth} />
<div style={containerWithInfoStyle}>
<div style={containersStyle}>
<span>Отображаемый месяц</span>
<span style={monthYearStyle}>{month}</span>
</div>
<div style={containersStyle}>
<span>Отображаемый год</span>
<span style={monthYearStyle}>{year}</span>
</div>
</div>
</div>
);
};
CalendarWithMonthChangeHandle.parameters = {
creevey: {
skip: {
'no themes': { in: /^(?!\b(chrome|firefox)\b)/ },
},
tests: {
async 'month and year change when selecting day'() {
await this.browser
.actions({ bridge: true })
.click(this.browser.findElement({ css: '[data-tid~="DayCellView__root"]' }))
.perform();
await delay(2000);

await this.expect(await this.takeScreenshot()).matchImage('month and year change when selecting day');
},
},
},
};

0 comments on commit b758964

Please sign in to comment.