Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"scripts": {
"storybook": "start-storybook -s ./node_modules/@salesforce-ux/design-system -p 9001 -c .storybook",
"test": "echo \"no test to run\"",
"pretest:visual": "storycap --serverCmd \"npm run storybook -- --ci\" http://localhost:9001 -o images --serverTimeout 3600000 --captureTimeout 10000 --delay 2000",
"pretest:visual": "storycap --serverCmd \"NODE_ENV=test npm run storybook -- --ci\" http://localhost:9001 -o images --serverTimeout 3600000 --captureTimeout 10000 --delay 2000",
"test:visual": "reg-suit -v run",
"type-check": "tsc --noEmit",
"type-check:watch": "npm run type-check -- --watch",
Expand Down
2 changes: 1 addition & 1 deletion src/scripts/Datepicker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ type Calendar = {
function createCalendarObject(date?: string, mnDate?: string, mxDate?: string) {
let minDate;
let maxDate;
let d = dayjs(date, 'YYYY-MM-DD');
let d = dayjs(date ?? null, 'YYYY-MM-DD');
if (!d.isValid()) {
d = dayjs(getToday(), 'YYYY-MM-DD');
}
Expand Down
4 changes: 2 additions & 2 deletions src/scripts/util.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { nanoid } from 'nanoid';
import { nanoid } from 'nanoid/non-secure';
import { updateScroll } from 'react-relative-portal';

export const generateUniqueId: () => string =
process.env.NODE_ENV === 'test' ? () => '$uuid$' : nanoid;

export const getToday =
process.env.NODE_ENV === 'test'
? () => '2017-02-23'
? () => '2022-05-18'
: () => new Date().toISOString().substring(0, 10);

let assetRoot = '/assets';
Expand Down