From eb00e9b68f25a0205197c23a5548ed43d005229d Mon Sep 17 00:00:00 2001 From: Leire Aguirre Date: Tue, 29 Oct 2024 11:08:22 +0100 Subject: [PATCH] fix and update test snaps --- .../base/base-date/base-date.test.ts | 53 +++++++++++++++++++ .../__snapshots__/BaseTableInfo.spec.js.snap | 20 +++---- .../TableFiltrableColumn.spec.js.snap | 2 +- .../SelectOptionsSearch.spec.js.snap | 2 +- 4 files changed, 65 insertions(+), 12 deletions(-) diff --git a/argilla-frontend/components/base/base-date/base-date.test.ts b/argilla-frontend/components/base/base-date/base-date.test.ts index 4c71569404..9a64dddb71 100644 --- a/argilla-frontend/components/base/base-date/base-date.test.ts +++ b/argilla-frontend/components/base/base-date/base-date.test.ts @@ -1,8 +1,16 @@ import { mount } from "@vue/test-utils"; import BaseDateVue from "./BaseDate.vue"; +import "vue-i18n"; + +const mocks = { + $i18n: { + locale: "en", + }, +}; const dateMocked = new Date("2023-07-19 00:00:00"); jest.useFakeTimers("modern").setSystemTime(dateMocked); +jest.mock("vue-i18n"); describe("Base Date should", () => { test("should format date correctly", () => { @@ -17,6 +25,11 @@ describe("Base Date should", () => { test("should format day 1 second ago", () => { const baseDate = mount(BaseDateVue, { + mocks: { + $i18n: { + locale: "en", + }, + }, propsData: { date: new Date("2023-07-18 23:59:59").toString(), format: "date-relative-now", @@ -28,6 +41,11 @@ describe("Base Date should", () => { test("should format day 2 seconds ago", () => { const baseDate = mount(BaseDateVue, { + mocks: { + $i18n: { + locale: "en", + }, + }, propsData: { date: new Date("2023-07-18 23:59:58").toString(), format: "date-relative-now", @@ -39,6 +57,11 @@ describe("Base Date should", () => { test("should format day 2 hours ago", () => { const baseDate = mount(BaseDateVue, { + mocks: { + $i18n: { + locale: "en", + }, + }, propsData: { date: new Date("2023-07-18 22:00").toString(), format: "date-relative-now", @@ -50,6 +73,11 @@ describe("Base Date should", () => { test("should format day as yesterday", () => { const baseDate = mount(BaseDateVue, { + mocks: { + $i18n: { + locale: "en", + }, + }, propsData: { date: new Date("2023-07-17 22:00").toString(), format: "date-relative-now", @@ -61,6 +89,11 @@ describe("Base Date should", () => { test("should format day 2 days ago", () => { const baseDate = mount(BaseDateVue, { + mocks: { + $i18n: { + locale: "en", + }, + }, propsData: { date: new Date("2023-07-16 22:00").toString(), format: "date-relative-now", @@ -72,6 +105,11 @@ describe("Base Date should", () => { test("should format day last week", () => { const baseDate = mount(BaseDateVue, { + mocks: { + $i18n: { + locale: "en", + }, + }, propsData: { date: new Date("2023-07-11 22:00").toString(), format: "date-relative-now", @@ -83,6 +121,11 @@ describe("Base Date should", () => { test("should format day 2 weeks ago", () => { const baseDate = mount(BaseDateVue, { + mocks: { + $i18n: { + locale: "en", + }, + }, propsData: { date: new Date("2023-07-01 22:00").toString(), format: "date-relative-now", @@ -94,6 +137,11 @@ describe("Base Date should", () => { test("should format day last month", () => { const baseDate = mount(BaseDateVue, { + mocks: { + $i18n: { + locale: "en", + }, + }, propsData: { date: new Date("2023-06-18 22:00").toString(), format: "date-relative-now", @@ -105,6 +153,11 @@ describe("Base Date should", () => { test("should format day 2 months ago", () => { const baseDate = mount(BaseDateVue, { + mocks: { + $i18n: { + locale: "en", + }, + }, propsData: { date: new Date("2023-05-18 22:00").toString(), format: "date-relative-now", diff --git a/argilla-frontend/components/base/base-table/__snapshots__/BaseTableInfo.spec.js.snap b/argilla-frontend/components/base/base-table/__snapshots__/BaseTableInfo.spec.js.snap index 408c589fa6..4f97888edd 100644 --- a/argilla-frontend/components/base/base-table/__snapshots__/BaseTableInfo.spec.js.snap +++ b/argilla-frontend/components/base/base-table/__snapshots__/BaseTableInfo.spec.js.snap @@ -2,22 +2,22 @@ exports[`BaseTableInfo renders properly 1`] = ` -
+
-
-
- +
+
+
-
-
    -
  • - recognai +
    +
      +
    • + recognai
    • -
    • - recognai +
    • + recognai
    diff --git a/argilla-frontend/components/base/base-table/__snapshots__/TableFiltrableColumn.spec.js.snap b/argilla-frontend/components/base/base-table/__snapshots__/TableFiltrableColumn.spec.js.snap index b46249229a..5bb68a4766 100644 --- a/argilla-frontend/components/base/base-table/__snapshots__/TableFiltrableColumn.spec.js.snap +++ b/argilla-frontend/components/base/base-table/__snapshots__/TableFiltrableColumn.spec.js.snap @@ -1,7 +1,7 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`TableFiltrableColumn renders properly 1`] = ` -