@astral/ui 1.0.0-test.1671107052 → 1.0.0-test.1671109027

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -57,6 +57,12 @@ describe('DatePicker', () => {
57
57
  const btn = tests_1.screen.getAllByText('9')[0];
58
58
  expect(btn).not.toBeDisabled();
59
59
  }));
60
+ it('Props:maxDate: в пикере выбранной отображается правильная выбранная дата при использовании даты со смещением', () => __awaiter(void 0, void 0, void 0, function* () {
61
+ (0, tests_1.renderWithTheme)((0, jsx_runtime_1.jsx)(DatePicker_1.DatePicker, { value: new Date('2022-12-16T18:59:00Z') }));
62
+ tests_1.fireEvent.focus(tests_1.screen.getByRole('textbox'));
63
+ const selected = tests_1.screen.getAllByText('16')[0].getAttribute('aria-selected');
64
+ expect(selected).toBeTruthy();
65
+ }));
60
66
  it('Props:value: при изменении меняется выбранная дата в календаре', () => __awaiter(void 0, void 0, void 0, function* () {
61
67
  const callbacks = {
62
68
  setValue: () => undefined,
@@ -55,6 +55,12 @@ describe('DatePicker', () => {
55
55
  const btn = screen.getAllByText('9')[0];
56
56
  expect(btn).not.toBeDisabled();
57
57
  }));
58
+ it('Props:maxDate: в пикере выбранной отображается правильная выбранная дата при использовании даты со смещением', () => __awaiter(void 0, void 0, void 0, function* () {
59
+ renderWithTheme(_jsx(DatePicker, { value: new Date('2022-12-16T18:59:00Z') }));
60
+ fireEvent.focus(screen.getByRole('textbox'));
61
+ const selected = screen.getAllByText('16')[0].getAttribute('aria-selected');
62
+ expect(selected).toBeTruthy();
63
+ }));
58
64
  it('Props:value: при изменении меняется выбранная дата в календаре', () => __awaiter(void 0, void 0, void 0, function* () {
59
65
  const callbacks = {
60
66
  setValue: () => undefined,
@@ -2,4 +2,4 @@ import dayjs from 'dayjs';
2
2
  /**
3
3
  * @description функция проверки значения на дату
4
4
  */
5
- export const isDate = (value) => dayjs(value).isValid();
5
+ export const isDate = (value) => Boolean(value) && dayjs(value).isValid();
package/package.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "@astral/ui",
3
- "version": "1.0.0-test.1671107052",
3
+ "version": "1.0.0-test.1671109027",
4
4
  "browser": "./esm/index.js",
5
5
  "main": "./index.js",
6
6
  "dependencies": {
7
- "@astral/icons": "^1.0.0-test.1671107052",
7
+ "@astral/icons": "^1.0.0-test.1671109027",
8
8
  "@emotion/cache": "11.7.1",
9
9
  "@emotion/react": "11.9.0",
10
10
  "@emotion/server": "11.4.0",
@@ -8,5 +8,5 @@ const dayjs_1 = __importDefault(require("dayjs"));
8
8
  /**
9
9
  * @description функция проверки значения на дату
10
10
  */
11
- const isDate = (value) => (0, dayjs_1.default)(value).isValid();
11
+ const isDate = (value) => Boolean(value) && (0, dayjs_1.default)(value).isValid();
12
12
  exports.isDate = isDate;