Socket
Socket
Sign inDemoInstall

cronofy-elements

Package Overview
Dependencies
Maintainers
3
Versions
171
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cronofy-elements - npm Package Compare versions

Comparing version 1.42.0 to 1.42.1

build/CronofyElements.v1.42.1.js

2

package.json
{
"name": "cronofy-elements",
"version": "1.42.0",
"version": "1.42.1",
"description": "Fast track scheduling with Cronofy's embeddable UI Elements",

@@ -5,0 +5,0 @@ "main": "build/npm/CronofyElements.js",

@@ -94,3 +94,8 @@ import moment from "moment-timezone";

if (!action.slots.length > 0) {
return state;
const monthsLoading = removeMonthFromLoading(state.monthsLoading, action.month);
return {
...state,
monthsLoading,
slotFetchCount: state.slotFetchCount + 1,
};
}

@@ -97,0 +102,0 @@

@@ -80,3 +80,3 @@ import moment from "moment-timezone";

const currentMonth =
current && moment(current, "YYYY-MM").isBetween(startMonth, endMonth)
current && moment(current, "YYYY-MM").isBetween(startMonth, endMonth, "month", "[]")
? current

@@ -83,0 +83,0 @@ : monthStrings[0];

@@ -343,2 +343,41 @@ import { statusReducer } from "../../../src/js/components/DateTimePicker/contexts/status-reducer";

it("sets slots when there are no slots", () => {
const oldState = {
...startingState,
slots: {},
availableDays: [],
slotFetchCount: 0,
slotInjectionPoint: undefined,
};
const result = statusReducer(oldState, {
type: "SET_SLOTS",
slots: [],
month: "2021-09",
tzid: "Europe/London",
});
delete oldState.slots;
delete oldState.availableDays;
delete oldState.slotFetchCount;
delete oldState.slotInjectionPoint;
const {
slots,
availableDays,
slotFetchCount,
slotInjectionPoint,
...newState
} = result;
// These values have been updated
expect(slots).toStrictEqual({});
expect(availableDays).toStrictEqual([]);
expect(slotFetchCount).toBe(1);
expect(slotInjectionPoint).toBe(undefined);
// All other values are unchanged
expect(newState).toStrictEqual(oldState);
});
it("sets additional slots", () => {

@@ -345,0 +384,0 @@ const oldState = {

import * as utils from "../../src/js/components/DateTimePicker/utils/slots";
import { rawSlots } from "./dummy-data";
import moment from "moment-timezone";

@@ -432,4 +433,49 @@ describe("DateTimePicker utils", () => {

});
it("returns with the correct month set to current when selectedDay is set", () => {
const selectedDay = "2021-07";
const query = {
query_periods,
};
const expected = [
{
month: "2021-06",
current: false,
query: {
query_periods: [
{
end: "2021-06-12T23:00:00Z",
start: "2021-06-11T00:00:00Z",
},
{
end: "2021-06-30T23:59:00Z",
start: "2021-06-13T00:00:00Z",
},
],
max_results: 512,
},
},
{
month: "2021-07",
current: true,
query: {
query_periods: [
{
end: "2021-07-14T23:00:00Z",
start: "2021-07-01T00:00:00Z",
},
],
max_results: 512,
},
},
];
const actual = utils.getMonthObjectsFromQuery(query, tzid, selectedDay);
expect(actual).toEqual(expected);
});
});
});
});

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc