Skip to content

Commit

Permalink
Change comparison of objects to use object comparison
Browse files Browse the repository at this point in the history
  • Loading branch information
ehuelsmann committed Nov 29, 2024
1 parent 41bb61c commit 5fb9de7
Show file tree
Hide file tree
Showing 8 changed files with 48 additions and 48 deletions.
22 changes: 11 additions & 11 deletions UI/tests/specs/stores/business-types.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,26 +15,26 @@ beforeEach(() => {
describe("Business Types Store", () => {
it("initialize", async () => {
await businessTypes.initialize();
expect(businessTypes.fields).toStrictEqual([
expect(businessTypes.fields).toMatchObject([
"id",
"description",
"discount"
]);
expect(businessTypes.items).toStrictEqual([
expect(businessTypes.items).toMatchObject([
{
id: "1",
description: "Big customer",
discount: 0.05,
_meta: { ETag: "1234567890" }
_meta: { "ETag": "1234567890" }
},
{
id: "2",
description: "Bigger customer",
discount: 0.15,
_meta: { ETag: "1234567890" }
_meta: { "ETag": "1234567890" }
}
]);
expect(businessTypes._links).toStrictEqual([
expect(businessTypes._links).toMatchObject([
{
title: "HTML",
rel: "download",
Expand All @@ -46,7 +46,7 @@ describe("Business Types Store", () => {
it("get Business Type #2", async () => {
await businessTypes.initialize();
const businessType = await businessTypes.get("2");
expect(businessType).toStrictEqual({
expect(businessType).toMatchObject({
_meta: { ETag: "1234567890" },
id: "2",
description: "Bigger customer",
Expand All @@ -61,18 +61,18 @@ describe("Business Types Store", () => {
description: "Bigger customer",
discount: 0.25
});
expect(businessTypes.items).toStrictEqual([
expect(businessTypes.items).toMatchObject([
{
id: "1",
description: "Big customer",
discount: 0.05,
_meta: { ETag: "1234567890" }
_meta: { "ETag": "1234567890" }
},
{
id: "2",
description: "Bigger customer",
discount: 0.25,
_meta: { ETag: "1234567891" }
_meta: { "ETag": "1234567891" }
}
]);
});
Expand All @@ -93,8 +93,8 @@ describe("Business Types Store", () => {
});
expect(
businessTypes.items[businessTypes.items.length - 1]
).toStrictEqual({
_meta: { ETag: "1234567891" },
).toMatchObject({
_meta: { "ETag": "1234567891" },
id: "3",
description: "Great customer",
discount: 0.22
Expand Down
12 changes: 6 additions & 6 deletions UI/tests/specs/stores/countries.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@ beforeEach(() => {
describe("Country Store", () => {
it("initialize", async () => {
await countries.initialize();
expect(countries.fields).toStrictEqual([
expect(countries.fields).toMatchObject([
"_meta",
"code",
"default",
"name"
]);
expect(countries.items).toStrictEqual([
expect(countries.items).toMatchObject([
{
code: "ca",
default: false,
Expand All @@ -35,7 +35,7 @@ describe("Country Store", () => {
_meta: { ETag: "1234567890" }
}
]);
expect(countries._links).toStrictEqual([
expect(countries._links).toMatchObject([
{
title: "HTML",
rel: "download",
Expand All @@ -47,7 +47,7 @@ describe("Country Store", () => {
it("get United States country us", async () => {
await countries.initialize();
const country = await countries.get("us");
expect(country).toStrictEqual({
expect(country).toMatchObject({
_meta: { ETag: "1234567890" },
code: "us",
default: false,
Expand All @@ -59,7 +59,7 @@ describe("Country Store", () => {
await countries.initialize();
await countries.get("us");
await countries.save("us", { code: "us", name: "America" });
expect(countries.items).toStrictEqual([
expect(countries.items).toMatchObject([
{
code: "ca",
default: false,
Expand All @@ -85,7 +85,7 @@ describe("Country Store", () => {
it("add Atlantida country zz", async () => {
await countries.initialize();
await countries.add({ code: "zz", name: "Atlantida" });
expect(countries.items[countries.items.length - 1]).toStrictEqual({
expect(countries.items[countries.items.length - 1]).toMatchObject({
_meta: { ETag: "1234567891" },
code: "zz",
name: "Atlantida"
Expand Down
10 changes: 5 additions & 5 deletions UI/tests/specs/stores/gifis.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ beforeEach(() => {
describe("GIFI Store", () => {
it("initialize", async () => {
await gifies.initialize();
expect(gifies.fields).toStrictEqual(["accno", "description"]);
expect(await gifies.items).toStrictEqual([
expect(gifies.fields).toMatchObject(["accno", "description"]);
expect(await gifies.items).toMatchObject([
{
accno: "0000",
description: "Dummy account",
Expand All @@ -33,7 +33,7 @@ describe("GIFI Store", () => {
it("get 0000", async () => {
await gifies.initialize();
const gifi = await gifies.get("0000");
expect(gifi).toStrictEqual({
expect(gifi).toMatchObject({
_meta: { ETag: "1234567890" },
accno: "0000",
description: "Dummy account"
Expand All @@ -47,7 +47,7 @@ describe("GIFI Store", () => {
accno: "0000",
description: "Funny account"
});
expect(gifies.items).toStrictEqual([
expect(gifies.items).toMatchObject([
{
accno: "0000",
description: "Funny account",
Expand All @@ -71,7 +71,7 @@ describe("GIFI Store", () => {
it("add Dummy account 0002", async () => {
await gifies.initialize();
await gifies.add({ accno: "0002", description: "Dummy account 2" });
expect(gifies.items[gifies.items.length - 1]).toStrictEqual({
expect(gifies.items[gifies.items.length - 1]).toMatchObject({
_meta: { ETag: "1234567891" },
accno: "0002",
description: "Dummy account 2"
Expand Down
12 changes: 6 additions & 6 deletions UI/tests/specs/stores/languages.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@ beforeEach(() => {
describe("Language Store", () => {
it("initialize", async () => {
await languages.initialize();
expect(languages.fields).toStrictEqual([
expect(languages.fields).toMatchObject([
"_meta",
"code",
"default",
"description"
]);
expect(languages.items).toStrictEqual([
expect(languages.items).toMatchObject([
{
code: "en",
default: false,
Expand All @@ -35,7 +35,7 @@ describe("Language Store", () => {
_meta: { ETag: "2345678901" }
}
]);
expect(languages._links).toStrictEqual([
expect(languages._links).toMatchObject([
{
title: "HTML",
rel: "download",
Expand All @@ -47,7 +47,7 @@ describe("Language Store", () => {
it("get English languages en", async () => {
await languages.initialize();
const language = await languages.get("en");
expect(language).toStrictEqual({
expect(language).toMatchObject({
_meta: { ETag: "1234567890" },
code: "en",
default: false,
Expand All @@ -62,7 +62,7 @@ describe("Language Store", () => {
code: "en",
description: "English (american)"
});
expect(languages.items).toStrictEqual([
expect(languages.items).toMatchObject([
{
code: "en",
default: false,
Expand All @@ -88,7 +88,7 @@ describe("Language Store", () => {
it("add Mayan language my", async () => {
await languages.initialize();
await languages.add({ code: "my", description: "Mayan" });
expect(languages.items[languages.items.length - 1]).toStrictEqual({
expect(languages.items[languages.items.length - 1]).toMatchObject({
_meta: { ETag: "1234567891" },
code: "my",
description: "Mayan"
Expand Down
12 changes: 6 additions & 6 deletions UI/tests/specs/stores/pricegroups.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ beforeEach(() => {
describe("Pricegroup Store", () => {
it("initialize", async () => {
await pricegroups.initialize();
expect(pricegroups.fields).toStrictEqual(["id", "description"]);
expect(pricegroups.items).toStrictEqual([
expect(pricegroups.fields).toMatchObject(["id", "description"]);
expect(pricegroups.items).toMatchObject([
{
id: "1",
description: "Price group 1",
Expand All @@ -28,7 +28,7 @@ describe("Pricegroup Store", () => {
_meta: { ETag: "1234567889" }
}
]);
expect(pricegroups._links).toStrictEqual([
expect(pricegroups._links).toMatchObject([
{
title: "HTML",
rel: "download",
Expand All @@ -40,7 +40,7 @@ describe("Pricegroup Store", () => {
it("get Price Group 1", async () => {
await pricegroups.initialize();
const pricegroup = await pricegroups.get("1");
expect(pricegroup).toStrictEqual({
expect(pricegroup).toMatchObject({
_meta: { ETag: "1234567890" },
id: "1",
description: "Price group 1"
Expand All @@ -51,7 +51,7 @@ describe("Pricegroup Store", () => {
await pricegroups.initialize();
await pricegroups.get("1");
await pricegroups.save("1", { id: "1", description: "Price Group #1" });
expect(pricegroups.items).toStrictEqual([
expect(pricegroups.items).toMatchObject([
{
id: "1",
description: "Price Group #1",
Expand All @@ -75,7 +75,7 @@ describe("Pricegroup Store", () => {
it("add Price Group 3", async () => {
await pricegroups.initialize();
await pricegroups.add({ id: "3", description: "Price Group #3" });
expect(pricegroups.items[pricegroups.items.length - 1]).toStrictEqual({
expect(pricegroups.items[pricegroups.items.length - 1]).toMatchObject({
_meta: { ETag: "1234567891" },
id: "3",
description: "Price Group #3"
Expand Down
4 changes: 2 additions & 2 deletions UI/tests/specs/stores/sessionUser.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@ describe("Session Store", () => {
it("initialize", async () => {
await session.initialize();
// expect(session.password_expiration).toBe("P1Y");
expect(session.roles).toStrictEqual([
expect(session.roles).toMatchObject([
"account_all",
"base_user",
"cash_all",
"gl_all"
]);
expect(session.preferences).toStrictEqual({
expect(session.preferences).toMatchObject({
numberformat: "1000.00",
printer: null,
stylesheet: "ledgersmb.css",
Expand Down
12 changes: 6 additions & 6 deletions UI/tests/specs/stores/sics.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ beforeEach(() => {
describe("Sic Store", () => {
it("initialize", async () => {
await sics.initialize();
expect(sics.fields).toStrictEqual(["code", "sictype", "description"]);
expect(sics.items).toStrictEqual([
expect(sics.fields).toMatchObject(["code", "sictype", "description"]);
expect(sics.items).toMatchObject([
{
code: "541330",
description: "Engineering service",
Expand All @@ -28,7 +28,7 @@ describe("Sic Store", () => {
_meta: { ETag: "1234567889" }
}
]);
expect(sics._links).toStrictEqual([
expect(sics._links).toMatchObject([
{
title: "HTML",
rel: "download",
Expand All @@ -40,7 +40,7 @@ describe("Sic Store", () => {
it("get Computer systems integrators sics 541330", async () => {
await sics.initialize();
const sic = await sics.get("541330");
expect(sic).toStrictEqual({
expect(sic).toMatchObject({
_meta: { ETag: "1234567890" },
code: "541330",
description: "Engineering service"
Expand All @@ -54,7 +54,7 @@ describe("Sic Store", () => {
code: "541330",
description: "Engineering services"
});
expect(sics.items).toStrictEqual([
expect(sics.items).toMatchObject([
{
code: "541330",
description: "Engineering services",
Expand All @@ -81,7 +81,7 @@ describe("Sic Store", () => {
code: "541510",
description: "Design of computer systems"
});
expect(sics.items[sics.items.length - 1]).toStrictEqual({
expect(sics.items[sics.items.length - 1]).toMatchObject({
_meta: { ETag: "1234567891" },
code: "541510",
description: "Design of computer systems"
Expand Down
12 changes: 6 additions & 6 deletions UI/tests/specs/stores/warehouses.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ beforeEach(() => {
describe("Warehouses Store", () => {
it("initialize", async () => {
await warehouses.initialize();
expect(warehouses.fields).toStrictEqual(["id", "description"]);
expect(warehouses.items).toStrictEqual([
expect(warehouses.fields).toMatchObject(["id", "description"]);
expect(warehouses.items).toMatchObject([
{
id: "1",
description: "Modern warehouse",
Expand All @@ -33,7 +33,7 @@ describe("Warehouses Store", () => {
_meta: { ETag: "1234567893" }
}
]);
expect(warehouses._links).toStrictEqual([
expect(warehouses._links).toMatchObject([
{
title: "HTML",
rel: "download",
Expand All @@ -45,7 +45,7 @@ describe("Warehouses Store", () => {
it("get warehouse #2", async () => {
await warehouses.initialize();
const warehouse = await warehouses.get("2");
expect(warehouse).toStrictEqual({
expect(warehouse).toMatchObject({
_meta: { ETag: "1234567890" },
id: "2",
description: "Huge warehouse"
Expand All @@ -59,7 +59,7 @@ describe("Warehouses Store", () => {
id: "2",
description: "Biggest warehouse"
});
expect(warehouses.items).toStrictEqual([
expect(warehouses.items).toMatchObject([
{
id: "1",
description: "Modern warehouse",
Expand Down Expand Up @@ -88,7 +88,7 @@ describe("Warehouses Store", () => {
it("add Mars warehouse", async () => {
await warehouses.initialize();
await warehouses.add({ id: "4", description: "Mars warehouse" });
expect(warehouses.items[warehouses.items.length - 1]).toStrictEqual({
expect(warehouses.items[warehouses.items.length - 1]).toMatchObject({
_meta: { ETag: "1234567891" },
id: "4",
description: "Mars warehouse"
Expand Down

0 comments on commit 5fb9de7

Please sign in to comment.