@projectcaluma/ember-testing 11.0.0-beta.1 → 11.0.0-beta.2

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.
package/CHANGELOG.md CHANGED
@@ -1,3 +1,10 @@
1
+ # [@projectcaluma/ember-testing-v11.0.0-beta.2](https://github.com/projectcaluma/ember-caluma/compare/@projectcaluma/ember-testing-v11.0.0-beta.1...@projectcaluma/ember-testing-v11.0.0-beta.2) (2022-02-07)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * **testing:** replace moment with luxon ([893c6f4](https://github.com/projectcaluma/ember-caluma/commit/893c6f4a907a65f5e55eab72c09b7703c780a3a5))
7
+
1
8
  # [@projectcaluma/ember-testing-v11.0.0-beta.1](https://github.com/projectcaluma/ember-caluma/compare/@projectcaluma/ember-testing-v10.2.0-beta.2...@projectcaluma/ember-testing-v11.0.0-beta.1) (2022-02-03)
2
9
 
3
10
 
@@ -1,4 +1,4 @@
1
- import moment from "moment";
1
+ import { DateTime } from "luxon";
2
2
 
3
3
  import { register } from "@projectcaluma/ember-testing/mirage-graphql";
4
4
  import BaseMock from "@projectcaluma/ember-testing/mirage-graphql/mocks/base";
@@ -74,13 +74,7 @@ export default class extends BaseMock {
74
74
  @register("SaveDefaultDateAnswerPayload")
75
75
  handleSaveDateAnswer(_, { input }) {
76
76
  const date = input.value;
77
- const value = date
78
- ? moment({
79
- day: date.getUTCDate(),
80
- month: date.getUTCMonth(),
81
- year: date.getUTCFullYear(),
82
- }).format(moment.HTML5_FMT.DATE)
83
- : null;
77
+ const value = date ? DateTime.fromJSDate(date).toISODate() : null;
84
78
 
85
79
  return this._handleSaveDocumentAnswer(_, {
86
80
  ...input,
@@ -1,4 +1,4 @@
1
- import moment from "moment";
1
+ import { DateTime } from "luxon";
2
2
 
3
3
  import {
4
4
  register,
@@ -77,7 +77,7 @@ export default class extends BaseMock {
77
77
  to: { id: group },
78
78
  from: { id: workItem.addressedGroups[0] },
79
79
  remark: "",
80
- deadline: moment().add(30, "days").toDate(),
80
+ deadline: DateTime.now().plus({ days: 30 }).toJSDate(),
81
81
  },
82
82
  {
83
83
  createdAt: new Date(),
@@ -1,5 +1,5 @@
1
1
  import { faker } from "@faker-js/faker";
2
- import moment from "moment";
2
+ import { DateTime } from "luxon";
3
3
 
4
4
  export function createBlueprint(server) {
5
5
  const inquiryForm = server.create("form", { slug: "inquiry" });
@@ -277,7 +277,7 @@ export default function (server, groups) {
277
277
  {
278
278
  from: g2,
279
279
  to: g,
280
- deadline: moment.utc().add(2, "days").toDate(),
280
+ deadline: DateTime.now().plus({ days: 2 }).toJSDate(),
281
281
  },
282
282
  { createdAt: faker.date.recent() }
283
283
  ),
@@ -1,6 +1,6 @@
1
1
  import { faker } from "@faker-js/faker";
2
+ import { DateTime } from "luxon";
2
3
  import { Factory } from "miragejs";
3
- import moment from "moment";
4
4
 
5
5
  export default Factory.extend({
6
6
  id: () => faker.datatype.uuid(),
@@ -73,13 +73,7 @@ export default Factory.extend({
73
73
 
74
74
  if (answer.value === undefined) {
75
75
  const date = faker.date.future();
76
- answer.update({
77
- value: moment({
78
- day: date.getUTCDate(),
79
- month: date.getUTCMonth(),
80
- year: date.getUTCFullYear(),
81
- }).format(moment.HTML5_FMT.DATE),
82
- });
76
+ answer.update({ value: DateTime.fromJSDate(date).toISODate() });
83
77
  }
84
78
  } else if (answer.question.type === "TABLE") {
85
79
  answer.update({ type: "TABLE" });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@projectcaluma/ember-testing",
3
- "version": "11.0.0-beta.1",
3
+ "version": "11.0.0-beta.2",
4
4
  "description": "Ember addon for testing with Caluma addons.",
5
5
  "keywords": [
6
6
  "ember-addon"
@@ -27,8 +27,8 @@
27
27
  "graphql": "^15.8.0",
28
28
  "graphql-iso-date": "^3.6.1",
29
29
  "graphql-tools": "^4.0.8",
30
- "miragejs": "^0.1.43",
31
- "moment": "^2.29.1"
30
+ "luxon": "^2.3.0",
31
+ "miragejs": "^0.1.43"
32
32
  },
33
33
  "devDependencies": {
34
34
  "@ember/optional-features": "2.0.0",