Frontend: Update JS tests after year change
This commit is contained in:
parent
0e4c458b90
commit
a8776a56a8
|
@ -83,7 +83,7 @@ describe("model/album", () => {
|
||||||
const values = {ID: 5, Title: "Christmas 2019", Slug: "christmas-2019", CreatedAt: "2012-07-08T14:45:39Z", Day: 8, Month: -5, Year: 800};
|
const values = {ID: 5, Title: "Christmas 2019", Slug: "christmas-2019", CreatedAt: "2012-07-08T14:45:39Z", Day: 8, Month: -5, Year: 800};
|
||||||
const album = new Album(values);
|
const album = new Album(values);
|
||||||
const result = album.yearString();
|
const result = album.yearString();
|
||||||
assert.equal(result, "2020");
|
assert.equal(result, new Date().getFullYear().toString().padStart(4, "0"));
|
||||||
});
|
});
|
||||||
|
|
||||||
it("should get model name", () => {
|
it("should get model name", () => {
|
||||||
|
|
|
@ -147,7 +147,7 @@ describe("model/photo", () => {
|
||||||
const values = {ID: 5, Title: "Crazy Cat", TakenAt: "2012-07-08T14:45:39Z", TimeZone: "UTC"};
|
const values = {ID: 5, Title: "Crazy Cat", TakenAt: "2012-07-08T14:45:39Z", TimeZone: "UTC"};
|
||||||
const photo = new Photo(values);
|
const photo = new Photo(values);
|
||||||
const result = photo.localYearString();
|
const result = photo.localYearString();
|
||||||
assert.equal(result, "2020");
|
assert.equal(result, new Date().getFullYear().toString().padStart(4, "0"));
|
||||||
const values2 = {ID: 5, Title: "Crazy Cat", TakenAtLocal: "2012-07-08T14:45:39Z", TakenAt: "2012-07-08T14:45:39Z", TimeZone: "UTC", Year: 2010};
|
const values2 = {ID: 5, Title: "Crazy Cat", TakenAtLocal: "2012-07-08T14:45:39Z", TakenAt: "2012-07-08T14:45:39Z", TimeZone: "UTC", Year: 2010};
|
||||||
const photo2 = new Photo(values2);
|
const photo2 = new Photo(values2);
|
||||||
const result2 = photo2.localYearString();
|
const result2 = photo2.localYearString();
|
||||||
|
|
Loading…
Reference in a new issue