update frontend lib : remove histoire (obselete) + update vitest - #1815
This commit is contained in:
@@ -0,0 +1,74 @@
|
||||
import { beforeEach, describe, it, expect } from "vitest";
|
||||
import { enUS } from "date-fns/locale";
|
||||
import { routes } from "@/router";
|
||||
import { createRouter, createWebHistory, Router } from "vue-router";
|
||||
import { config, mount } from "@vue/test-utils";
|
||||
import { Oruga } from "@oruga-ui/oruga-next";
|
||||
import flushPromises from "flush-promises";
|
||||
import { getMockClient } from "../../mocks/client";
|
||||
import { htmlRemoveId } from "../../common";
|
||||
import InstanceContactLink from "@/components/About/InstanceContactLink.vue";
|
||||
|
||||
config.global.plugins.push(Oruga);
|
||||
|
||||
let router: Router;
|
||||
|
||||
beforeEach(async () => {
|
||||
router = createRouter({
|
||||
history: createWebHistory(),
|
||||
routes: routes,
|
||||
});
|
||||
|
||||
// await router.isReady();
|
||||
});
|
||||
|
||||
const generateWrapper = (props: any = {}) => {
|
||||
const global_data = getMockClient([]);
|
||||
global_data.provide.dateFnsLocale = enUS;
|
||||
global_data.plugins = [router];
|
||||
return mount(InstanceContactLink, {
|
||||
props: props,
|
||||
global: {
|
||||
...global_data,
|
||||
stubs: {
|
||||
RouterLink: false,
|
||||
},
|
||||
},
|
||||
});
|
||||
};
|
||||
|
||||
describe("InstanceContactLink", () => {
|
||||
it("Show empty", async () => {
|
||||
const wrapper = generateWrapper();
|
||||
await wrapper.vm.$nextTick();
|
||||
await flushPromises();
|
||||
expect(htmlRemoveId(wrapper.html())).toMatchSnapshot();
|
||||
});
|
||||
|
||||
it("Show string", async () => {
|
||||
const wrapper = generateWrapper({
|
||||
contact: "someone",
|
||||
});
|
||||
await wrapper.vm.$nextTick();
|
||||
await flushPromises();
|
||||
expect(htmlRemoveId(wrapper.html())).toMatchSnapshot();
|
||||
});
|
||||
|
||||
it("Show email", async () => {
|
||||
const wrapper = generateWrapper({
|
||||
contact: "someone@somewhere.tld",
|
||||
});
|
||||
await wrapper.vm.$nextTick();
|
||||
await flushPromises();
|
||||
expect(htmlRemoveId(wrapper.html())).toMatchSnapshot();
|
||||
});
|
||||
|
||||
it("Show url", async () => {
|
||||
const wrapper = generateWrapper({
|
||||
contact: "https://somewhere.com",
|
||||
});
|
||||
await wrapper.vm.$nextTick();
|
||||
await flushPromises();
|
||||
expect(htmlRemoveId(wrapper.html())).toMatchSnapshot();
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,9 @@
|
||||
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
|
||||
|
||||
exports[`InstanceContactLink > Show email 1`] = `"<p><a dir="auto" title="someone@somewhere.tld" href="mailto:someone@somewhere.tld">someone@somewhere.tld</a></p>"`;
|
||||
|
||||
exports[`InstanceContactLink > Show empty 1`] = `"<p><span>contact uninformed</span></p>"`;
|
||||
|
||||
exports[`InstanceContactLink > Show string 1`] = `"<p><span dir="auto">someone</span></p>"`;
|
||||
|
||||
exports[`InstanceContactLink > Show url 1`] = `"<p><a dir="auto" title="https://somewhere.com" href="https://somewhere.com">somewhere.com</a></p>"`;
|
||||
87
tests/unit/specs/components/Account/ActorCard.spec.ts
Normal file
87
tests/unit/specs/components/Account/ActorCard.spec.ts
Normal file
@@ -0,0 +1,87 @@
|
||||
import { beforeEach, describe, it, expect } from "vitest";
|
||||
import { enUS } from "date-fns/locale";
|
||||
import { routes } from "@/router";
|
||||
import { createRouter, createWebHistory, Router } from "vue-router";
|
||||
import { config, mount } from "@vue/test-utils";
|
||||
import { Oruga } from "@oruga-ui/oruga-next";
|
||||
import flushPromises from "flush-promises";
|
||||
import { getMockClient } from "../../mocks/client";
|
||||
import { htmlRemoveId } from "../../common";
|
||||
import ActorCard from "@/components/Account/ActorCard.vue";
|
||||
import { reactive, ref } from "vue";
|
||||
import { IActor } from "@/types/actor";
|
||||
import { ActorType } from "@/types/enums";
|
||||
|
||||
config.global.plugins.push(Oruga);
|
||||
|
||||
let router: Router;
|
||||
|
||||
beforeEach(async () => {
|
||||
router = createRouter({
|
||||
history: createWebHistory(),
|
||||
routes: routes,
|
||||
});
|
||||
|
||||
// await router.isReady();
|
||||
});
|
||||
|
||||
const avatarUrl = ref<string>(
|
||||
"https://stockage.framapiaf.org/framapiaf/accounts/avatars/000/000/399/original/52b08a3e80b43d40.jpg"
|
||||
);
|
||||
|
||||
const stateLocal = reactive<IActor>({
|
||||
name: "Thomas Citharel",
|
||||
preferredUsername: "tcit",
|
||||
avatar: null,
|
||||
domain: null,
|
||||
url: "",
|
||||
summary: "",
|
||||
suspended: false,
|
||||
type: ActorType.PERSON,
|
||||
});
|
||||
|
||||
const stateRemote = reactive<IActor>({
|
||||
name: "Framasoft",
|
||||
preferredUsername: "framasoft",
|
||||
avatar: { url: avatarUrl.value, id: "", name: "", alt: "", metadata: {} },
|
||||
domain: "framapiaf.org",
|
||||
url: "",
|
||||
summary: "",
|
||||
suspended: false,
|
||||
type: ActorType.PERSON,
|
||||
});
|
||||
|
||||
const generateWrapper = (props: any) => {
|
||||
const global_data = getMockClient([]);
|
||||
global_data.provide.dateFnsLocale = enUS;
|
||||
global_data.plugins = [router];
|
||||
return mount(ActorCard, {
|
||||
props: props,
|
||||
global: {
|
||||
...global_data,
|
||||
stubs: {
|
||||
RouterLink: false,
|
||||
},
|
||||
},
|
||||
});
|
||||
};
|
||||
|
||||
describe("ActorCard", () => {
|
||||
it("Show local", async () => {
|
||||
const wrapper = generateWrapper({
|
||||
actor: stateLocal,
|
||||
});
|
||||
await wrapper.vm.$nextTick();
|
||||
await flushPromises();
|
||||
expect(htmlRemoveId(wrapper.html())).toMatchSnapshot();
|
||||
});
|
||||
|
||||
it("Show simple", async () => {
|
||||
const wrapper = generateWrapper({
|
||||
actor: stateRemote,
|
||||
});
|
||||
await wrapper.vm.$nextTick();
|
||||
await flushPromises();
|
||||
expect(htmlRemoveId(wrapper.html())).toMatchSnapshot();
|
||||
});
|
||||
});
|
||||
87
tests/unit/specs/components/Account/ActorInline.spec.ts
Normal file
87
tests/unit/specs/components/Account/ActorInline.spec.ts
Normal file
@@ -0,0 +1,87 @@
|
||||
import { beforeEach, describe, it, expect } from "vitest";
|
||||
import { enUS } from "date-fns/locale";
|
||||
import { routes } from "@/router";
|
||||
import { createRouter, createWebHistory, Router } from "vue-router";
|
||||
import { config, mount } from "@vue/test-utils";
|
||||
import { Oruga } from "@oruga-ui/oruga-next";
|
||||
import flushPromises from "flush-promises";
|
||||
import { getMockClient } from "../../mocks/client";
|
||||
import { htmlRemoveId } from "../../common";
|
||||
import ActorInline from "@/components/Account/ActorInline.vue";
|
||||
import { reactive, ref } from "vue";
|
||||
import { IActor } from "@/types/actor";
|
||||
import { ActorType } from "@/types/enums";
|
||||
|
||||
config.global.plugins.push(Oruga);
|
||||
|
||||
let router: Router;
|
||||
|
||||
beforeEach(async () => {
|
||||
router = createRouter({
|
||||
history: createWebHistory(),
|
||||
routes: routes,
|
||||
});
|
||||
|
||||
// await router.isReady();
|
||||
});
|
||||
|
||||
const generateWrapper = (props: any) => {
|
||||
const global_data = getMockClient([]);
|
||||
global_data.provide.dateFnsLocale = enUS;
|
||||
global_data.plugins = [router];
|
||||
return mount(ActorInline, {
|
||||
props: props,
|
||||
global: {
|
||||
...global_data,
|
||||
stubs: {
|
||||
RouterLink: false,
|
||||
},
|
||||
},
|
||||
});
|
||||
};
|
||||
|
||||
const avatarUrl = ref<string>(
|
||||
"https://stockage.framapiaf.org/framapiaf/accounts/avatars/000/000/399/original/52b08a3e80b43d40.jpg"
|
||||
);
|
||||
|
||||
const stateLocal = reactive<IActor>({
|
||||
name: "Thomas Citharel",
|
||||
preferredUsername: "tcit",
|
||||
avatar: null,
|
||||
domain: null,
|
||||
url: "",
|
||||
summary: "",
|
||||
suspended: false,
|
||||
type: ActorType.PERSON,
|
||||
});
|
||||
|
||||
const stateRemote = reactive<IActor>({
|
||||
name: "Framasoft",
|
||||
preferredUsername: "framasoft",
|
||||
avatar: { url: avatarUrl.value, id: "", name: "", alt: "", metadata: {} },
|
||||
domain: "framapiaf.org",
|
||||
url: "",
|
||||
summary: "",
|
||||
suspended: false,
|
||||
type: ActorType.PERSON,
|
||||
});
|
||||
|
||||
describe("ActorInline", () => {
|
||||
it("Show local", async () => {
|
||||
const wrapper = generateWrapper({
|
||||
actor: stateLocal,
|
||||
});
|
||||
await wrapper.vm.$nextTick();
|
||||
await flushPromises();
|
||||
expect(htmlRemoveId(wrapper.html())).toMatchSnapshot();
|
||||
});
|
||||
|
||||
it("Show remote", async () => {
|
||||
const wrapper = generateWrapper({
|
||||
actor: stateRemote,
|
||||
});
|
||||
await wrapper.vm.$nextTick();
|
||||
await flushPromises();
|
||||
expect(htmlRemoveId(wrapper.html())).toMatchSnapshot();
|
||||
});
|
||||
});
|
||||
90
tests/unit/specs/components/Account/PopoverActorCard.spec.ts
Normal file
90
tests/unit/specs/components/Account/PopoverActorCard.spec.ts
Normal file
@@ -0,0 +1,90 @@
|
||||
import { beforeEach, describe, it, expect } from "vitest";
|
||||
import { enUS } from "date-fns/locale";
|
||||
import { routes } from "@/router";
|
||||
import { createRouter, createWebHistory, Router } from "vue-router";
|
||||
import { config, mount } from "@vue/test-utils";
|
||||
import { Oruga } from "@oruga-ui/oruga-next";
|
||||
import flushPromises from "flush-promises";
|
||||
import { getMockClient, requestHandlers } from "../../mocks/client";
|
||||
import { htmlRemoveId } from "../../common";
|
||||
import PopoverActorCard from "@/components/Account/PopoverActorCard.vue";
|
||||
import { ActorType } from "@/types/enums";
|
||||
|
||||
config.global.plugins.push(Oruga);
|
||||
|
||||
let router: Router;
|
||||
|
||||
beforeEach(async () => {
|
||||
router = createRouter({
|
||||
history: createWebHistory(),
|
||||
routes: routes,
|
||||
});
|
||||
|
||||
// await router.isReady();
|
||||
});
|
||||
|
||||
const baseActorAvatar = {
|
||||
id: "",
|
||||
name: "",
|
||||
alt: "",
|
||||
metadata: {},
|
||||
url: "https://social.tcit.fr/system/accounts/avatars/000/000/001/original/a28c50ce5f2b13fd.jpg",
|
||||
};
|
||||
|
||||
const baseActor = {
|
||||
name: "Thomas Citharel",
|
||||
preferredUsername: "tcit",
|
||||
avatar: baseActorAvatar,
|
||||
domain: null,
|
||||
url: "",
|
||||
summary: "",
|
||||
suspended: false,
|
||||
type: ActorType.PERSON,
|
||||
};
|
||||
|
||||
const group = {
|
||||
...baseActor,
|
||||
name: "Framasoft",
|
||||
preferredUsername: "framasoft",
|
||||
domain: "mobilizon.fr",
|
||||
avatar: {
|
||||
...baseActorAvatar,
|
||||
url: "https://stockage.framapiaf.org/framapiaf/accounts/avatars/000/000/399/original/52b08a3e80b43d40.jpg",
|
||||
},
|
||||
};
|
||||
|
||||
const generateWrapper = (actor: any) => {
|
||||
const global_data = getMockClient([]);
|
||||
global_data.provide.dateFnsLocale = enUS;
|
||||
global_data.plugins = [router];
|
||||
return mount(PopoverActorCard, {
|
||||
props: {
|
||||
actor: actor,
|
||||
},
|
||||
global: {
|
||||
...global_data,
|
||||
stubs: {
|
||||
RouterLink: false,
|
||||
},
|
||||
},
|
||||
slots: {
|
||||
default: "<div><b> Popover me !</b></div>",
|
||||
},
|
||||
});
|
||||
};
|
||||
|
||||
describe("PopoverActorCard", () => {
|
||||
it("Show Person", async () => {
|
||||
const wrapper = generateWrapper(baseActor);
|
||||
await wrapper.vm.$nextTick();
|
||||
await flushPromises();
|
||||
expect(htmlRemoveId(wrapper.html())).toMatchSnapshot();
|
||||
});
|
||||
|
||||
it("Show Group", async () => {
|
||||
const wrapper = generateWrapper(group);
|
||||
await wrapper.vm.$nextTick();
|
||||
await flushPromises();
|
||||
expect(htmlRemoveId(wrapper.html())).toMatchSnapshot();
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,63 @@
|
||||
import { beforeEach, describe, it, expect } from "vitest";
|
||||
import { enUS } from "date-fns/locale";
|
||||
import { routes } from "@/router";
|
||||
import { createRouter, createWebHistory, Router } from "vue-router";
|
||||
import { config, mount } from "@vue/test-utils";
|
||||
import { Oruga } from "@oruga-ui/oruga-next";
|
||||
import flushPromises from "flush-promises";
|
||||
import { getMockClient } from "../../mocks/client";
|
||||
import { htmlRemoveId } from "../../common";
|
||||
import ProfileOnboarding from "@/components/Account/ProfileOnboarding.vue";
|
||||
import { ActorType } from "@/types/enums";
|
||||
import { IPerson } from "@/types/actor";
|
||||
|
||||
config.global.plugins.push(Oruga);
|
||||
|
||||
let router: Router;
|
||||
|
||||
beforeEach(async () => {
|
||||
router = createRouter({
|
||||
history: createWebHistory(),
|
||||
routes: routes,
|
||||
});
|
||||
|
||||
// await router.isReady();
|
||||
});
|
||||
|
||||
const baseActor: IPerson = {
|
||||
name: "Thomas Citharel",
|
||||
preferredUsername: "tcit",
|
||||
avatar: null,
|
||||
domain: null,
|
||||
url: "",
|
||||
summary: "",
|
||||
suspended: false,
|
||||
type: ActorType.PERSON,
|
||||
};
|
||||
|
||||
const generateWrapper = (props: any) => {
|
||||
const global_data = getMockClient([]);
|
||||
global_data.provide.dateFnsLocale = enUS;
|
||||
global_data.plugins = [router];
|
||||
return mount(ProfileOnboarding, {
|
||||
props: props,
|
||||
global: {
|
||||
...global_data,
|
||||
stubs: {
|
||||
RouterLink: false,
|
||||
},
|
||||
},
|
||||
});
|
||||
};
|
||||
|
||||
describe("ProfileOnboarding", () => {
|
||||
it("Show simple", async () => {
|
||||
const wrapper = generateWrapper({
|
||||
currentActor: baseActor,
|
||||
instanceName: "Instance name",
|
||||
});
|
||||
await wrapper.vm.$nextTick();
|
||||
await flushPromises();
|
||||
expect(htmlRemoveId(wrapper.html())).toMatchSnapshot();
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,103 @@
|
||||
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
|
||||
|
||||
exports[`ActorCard > Show local 1`] = `
|
||||
"<div data-v-b0ff4ece="" class="bg-white dark:bg-mbz-purple rounded-lg flex space-x-4 items-center flex-col p-4 shadow-md sm:p-8 pb-10 w-80">
|
||||
<div data-v-b0ff4ece="" class="flex pl-2"><span data-v-b0ff4ece="" class="ltr:-mr-0.5 rtl:-ml-0.5 material-design-icon account-circle-icon ltr:-mr-0.5 rtl:-ml-0.5" aria-hidden="true" role="img"><svg fill="currentColor" class="material-design-icon__svg" width="48" height="48" viewBox="0 0 24 24"><path d="M12,19.2C9.5,19.2 7.29,17.92 6,16C6.03,14 10,12.9 12,12.9C14,12.9 17.97,14 18,16C16.71,17.92 14.5,19.2 12,19.2M12,5A3,3 0 0,1 15,8A3,3 0 0,1 12,11A3,3 0 0,1 9,8A3,3 0 0,1 12,5M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12C22,6.47 17.5,2 12,2Z"><!--v-if--></path></svg></span></div>
|
||||
<div data-v-b0ff4ece="" class="text-center overflow-hidden w-full">
|
||||
<h5 data-v-b0ff4ece="" class="text-xl font-medium violet-title tracking-tight text-gray-900 dark:text-gray-200 whitespace-pre-line line-clamp-2">Thomas Citharel</h5>
|
||||
<p data-v-b0ff4ece="" class="text-gray-500 dark:text-gray-200 truncate"><span data-v-b0ff4ece="" dir="ltr">@tcit</span></p>
|
||||
<!--v-if-->
|
||||
<!--v-if-->
|
||||
</div>
|
||||
<div data-v-b0ff4ece="" class="flex pr-2"><a data-v-b0ff4ece="" href="/conversations?newMessage=true&personMentions=tcit" class=""><span data-v-b0ff4ece="" aria-hidden="true" class="material-design-icon email-icon" role="img"><svg fill="currentColor" class="material-design-icon__svg" width="24" height="24" viewBox="0 0 24 24"><path d="M20,8L12,13L4,8V6L12,11L20,6M20,4H4C2.89,4 2,4.89 2,6V18A2,2 0 0,0 4,20H20A2,2 0 0,0 22,18V6C22,4.89 21.1,4 20,4Z"><!--v-if--></path></svg></span></a></div>
|
||||
</div>
|
||||
<!-- <div
|
||||
class="p-4 bg-white rounded-lg shadow-md sm:p-8 flex items-center space-x-4"
|
||||
dir="auto"
|
||||
>
|
||||
<div class="flex-shrink-0">
|
||||
<figure class="w-12 h-12" v-if="actor.avatar">
|
||||
<img
|
||||
class="rounded-lg"
|
||||
:src="actor.avatar.url"
|
||||
alt=""
|
||||
width="48"
|
||||
height="48"
|
||||
/>
|
||||
</figure>
|
||||
<o-icon
|
||||
v-else
|
||||
size="large"
|
||||
icon="account-circle"
|
||||
class="ltr:-mr-0.5 rtl:-ml-0.5"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div class="flex-1 min-w-0">
|
||||
<h5 class="text-xl font-medium violet-title tracking-tight text-gray-900">
|
||||
{{ displayName(actor) }}
|
||||
</h5>
|
||||
<p class="text-gray-500 truncate" v-if="actor.name">
|
||||
<span dir="ltr">@{{ usernameWithDomain(actor) }}</span>
|
||||
</p>
|
||||
<div
|
||||
v-if="full"
|
||||
class="line-clamp-3"
|
||||
:class="{ limit: limit }"
|
||||
v-html="actor.summary"
|
||||
/>
|
||||
</div>
|
||||
</div> -->"
|
||||
`;
|
||||
|
||||
exports[`ActorCard > Show simple 1`] = `
|
||||
"<div data-v-b0ff4ece="" class="bg-white dark:bg-mbz-purple rounded-lg flex space-x-4 items-center flex-col p-4 shadow-md sm:p-8 pb-10 w-80">
|
||||
<div data-v-b0ff4ece="" class="flex pl-2">
|
||||
<figure data-v-b0ff4ece="" class="w-12 h-12"><img data-v-b0ff4ece="" class="rounded-full object-cover h-full" src="https://stockage.framapiaf.org/framapiaf/accounts/avatars/000/000/399/original/52b08a3e80b43d40.jpg" alt="" width="48" height="48" loading="lazy"></figure>
|
||||
</div>
|
||||
<div data-v-b0ff4ece="" class="text-center overflow-hidden w-full">
|
||||
<h5 data-v-b0ff4ece="" class="text-xl font-medium violet-title tracking-tight text-gray-900 dark:text-gray-200 whitespace-pre-line line-clamp-2">Framasoft</h5>
|
||||
<p data-v-b0ff4ece="" class="text-gray-500 dark:text-gray-200 truncate"><span data-v-b0ff4ece="" dir="ltr">@framasoft@framapiaf.org</span></p>
|
||||
<!--v-if-->
|
||||
<!--v-if-->
|
||||
</div>
|
||||
<div data-v-b0ff4ece="" class="flex pr-2"><a data-v-b0ff4ece="" href="/conversations?newMessage=true&personMentions=framasoft@framapiaf.org" class=""><span data-v-b0ff4ece="" aria-hidden="true" class="material-design-icon email-icon" role="img"><svg fill="currentColor" class="material-design-icon__svg" width="24" height="24" viewBox="0 0 24 24"><path d="M20,8L12,13L4,8V6L12,11L20,6M20,4H4C2.89,4 2,4.89 2,6V18A2,2 0 0,0 4,20H20A2,2 0 0,0 22,18V6C22,4.89 21.1,4 20,4Z"><!--v-if--></path></svg></span></a></div>
|
||||
</div>
|
||||
<!-- <div
|
||||
class="p-4 bg-white rounded-lg shadow-md sm:p-8 flex items-center space-x-4"
|
||||
dir="auto"
|
||||
>
|
||||
<div class="flex-shrink-0">
|
||||
<figure class="w-12 h-12" v-if="actor.avatar">
|
||||
<img
|
||||
class="rounded-lg"
|
||||
:src="actor.avatar.url"
|
||||
alt=""
|
||||
width="48"
|
||||
height="48"
|
||||
/>
|
||||
</figure>
|
||||
<o-icon
|
||||
v-else
|
||||
size="large"
|
||||
icon="account-circle"
|
||||
class="ltr:-mr-0.5 rtl:-ml-0.5"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div class="flex-1 min-w-0">
|
||||
<h5 class="text-xl font-medium violet-title tracking-tight text-gray-900">
|
||||
{{ displayName(actor) }}
|
||||
</h5>
|
||||
<p class="text-gray-500 truncate" v-if="actor.name">
|
||||
<span dir="ltr">@{{ usernameWithDomain(actor) }}</span>
|
||||
</p>
|
||||
<div
|
||||
v-if="full"
|
||||
class="line-clamp-3"
|
||||
:class="{ limit: limit }"
|
||||
v-html="actor.summary"
|
||||
/>
|
||||
</div>
|
||||
</div> -->"
|
||||
`;
|
||||
@@ -0,0 +1,23 @@
|
||||
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
|
||||
|
||||
exports[`ActorInline > Show local 1`] = `
|
||||
"<div data-v-397a2c1c="" class="inline-flex items-start gap-2 bg-white dark:bg-violet-1 dark:text-white p-2 rounded-md">
|
||||
<div data-v-397a2c1c="" class="flex-none"><span data-v-397a2c1c="" aria-hidden="true" class="material-design-icon account-circle-icon" role="img"><svg fill="currentColor" class="material-design-icon__svg" width="36" height="36" viewBox="0 0 24 24"><path d="M12,19.2C9.5,19.2 7.29,17.92 6,16C6.03,14 10,12.9 12,12.9C14,12.9 17.97,14 18,16C16.71,17.92 14.5,19.2 12,19.2M12,5A3,3 0 0,1 15,8A3,3 0 0,1 12,11A3,3 0 0,1 9,8A3,3 0 0,1 12,5M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12C22,6.47 17.5,2 12,2Z"><!--v-if--></path></svg></span></div>
|
||||
<div data-v-397a2c1c="" class="flex-auto">
|
||||
<p data-v-397a2c1c="" class="text-lg line-clamp-3 md:line-clamp-2 max-w-xl">Thomas Citharel</p>
|
||||
<p data-v-397a2c1c="" class="text-sm text-gray-500 dark:text-gray-300 truncate"> @tcit</p>
|
||||
</div>
|
||||
</div>"
|
||||
`;
|
||||
|
||||
exports[`ActorInline > Show remote 1`] = `
|
||||
"<div data-v-397a2c1c="" class="inline-flex items-start gap-2 bg-white dark:bg-violet-1 dark:text-white p-2 rounded-md">
|
||||
<div data-v-397a2c1c="" class="flex-none">
|
||||
<figure data-v-397a2c1c=""><img data-v-397a2c1c="" class="rounded-xl" src="https://stockage.framapiaf.org/framapiaf/accounts/avatars/000/000/399/original/52b08a3e80b43d40.jpg" alt="" width="36" height="36" loading="lazy"></figure>
|
||||
</div>
|
||||
<div data-v-397a2c1c="" class="flex-auto">
|
||||
<p data-v-397a2c1c="" class="text-lg line-clamp-3 md:line-clamp-2 max-w-xl">Framasoft</p>
|
||||
<p data-v-397a2c1c="" class="text-sm text-gray-500 dark:text-gray-300 truncate"> @framasoft@framapiaf.org</p>
|
||||
</div>
|
||||
</div>"
|
||||
`;
|
||||
@@ -0,0 +1,13 @@
|
||||
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
|
||||
|
||||
exports[`PopoverActorCard > Show Group 1`] = `
|
||||
"<vmenu distance="16" triggers="hover" class="popover">
|
||||
<div><b> Popover me !</b></div>
|
||||
</vmenu>"
|
||||
`;
|
||||
|
||||
exports[`PopoverActorCard > Show Person 1`] = `
|
||||
"<vmenu distance="16" triggers="hover" class="popover">
|
||||
<div><b> Popover me !</b></div>
|
||||
</vmenu>"
|
||||
`;
|
||||
@@ -0,0 +1,13 @@
|
||||
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
|
||||
|
||||
exports[`ProfileOnboarding > Show simple 1`] = `
|
||||
"<div class="">
|
||||
<h2 class="text-2xl">Profiles and federation</h2>
|
||||
</div>
|
||||
<p class="my-2">Mobilizon uses a system of profiles to compartiment your activities. You will be able to create as many profiles as you want.</p>
|
||||
<hr role="presentation">
|
||||
<p class="my-2"><span>Mobilizon is a federated software, meaning you can interact - depending on your admin's federation settings - with content from other instances, such as joining groups or events that were created elsewhere.</span>This instance, <b>Instance name (localhost)</b>, hosts your profile, so remember its name.</p>
|
||||
<hr role="presentation">
|
||||
<p class="my-2">If you are being asked for your federated indentity, it's composed of your username and your instance. For instance, the federated identity for your first profile is:</p>
|
||||
<div class="text-center"><code>tcit@localhost</code></div>"
|
||||
`;
|
||||
73
tests/unit/specs/components/Address/AddressInfo.spec.ts
Normal file
73
tests/unit/specs/components/Address/AddressInfo.spec.ts
Normal file
@@ -0,0 +1,73 @@
|
||||
import { beforeEach, describe, it, expect } from "vitest";
|
||||
import { enUS } from "date-fns/locale";
|
||||
import { routes } from "@/router";
|
||||
import { createRouter, createWebHistory, Router } from "vue-router";
|
||||
import { config, mount } from "@vue/test-utils";
|
||||
import { Oruga } from "@oruga-ui/oruga-next";
|
||||
import flushPromises from "flush-promises";
|
||||
import { getMockClient } from "../../mocks/client";
|
||||
import { htmlRemoveId } from "../../common";
|
||||
import AddressInfo from "@/components/Address/AddressInfo.vue";
|
||||
import { IAddress } from "@/types/address.model";
|
||||
import { reactive } from "vue";
|
||||
|
||||
config.global.plugins.push(Oruga);
|
||||
|
||||
let router: Router;
|
||||
|
||||
beforeEach(async () => {
|
||||
router = createRouter({
|
||||
history: createWebHistory(),
|
||||
routes: routes,
|
||||
});
|
||||
|
||||
// await router.isReady();
|
||||
});
|
||||
|
||||
const generateWrapper = (props: any) => {
|
||||
const global_data = getMockClient([]);
|
||||
global_data.provide.dateFnsLocale = enUS;
|
||||
global_data.plugins = [router];
|
||||
return mount(AddressInfo, {
|
||||
props: props,
|
||||
global: {
|
||||
...global_data,
|
||||
stubs: {
|
||||
RouterLink: false,
|
||||
},
|
||||
},
|
||||
});
|
||||
};
|
||||
|
||||
const address = reactive<IAddress>({
|
||||
description: "Locaux Motiv",
|
||||
street: "10 Rue Jangot",
|
||||
locality: "Lyon",
|
||||
postalCode: "69007",
|
||||
region: "Auvergne Rhône-Alpes",
|
||||
country: "France",
|
||||
type: "",
|
||||
timezone: "Europe/Dublin",
|
||||
});
|
||||
|
||||
describe("AddressInfo", () => {
|
||||
it("Show Basic", async () => {
|
||||
const wrapper = generateWrapper({
|
||||
address: address,
|
||||
});
|
||||
await wrapper.vm.$nextTick();
|
||||
await flushPromises();
|
||||
expect(htmlRemoveId(wrapper.html())).toMatchSnapshot();
|
||||
});
|
||||
|
||||
it("Show Basic with timezone", async () => {
|
||||
const wrapper = generateWrapper({
|
||||
address: address,
|
||||
showTimezone: true,
|
||||
userTimezone: "Europe/Berlin",
|
||||
});
|
||||
await wrapper.vm.$nextTick();
|
||||
await flushPromises();
|
||||
expect(htmlRemoveId(wrapper.html())).toMatchSnapshot();
|
||||
});
|
||||
});
|
||||
71
tests/unit/specs/components/Address/InlineAddress.spec.ts
Normal file
71
tests/unit/specs/components/Address/InlineAddress.spec.ts
Normal file
@@ -0,0 +1,71 @@
|
||||
import { beforeEach, describe, it, expect } from "vitest";
|
||||
import { enUS } from "date-fns/locale";
|
||||
import { routes } from "@/router";
|
||||
import { createRouter, createWebHistory, Router } from "vue-router";
|
||||
import { config, mount } from "@vue/test-utils";
|
||||
import { Oruga } from "@oruga-ui/oruga-next";
|
||||
import flushPromises from "flush-promises";
|
||||
import { getMockClient } from "../../mocks/client";
|
||||
import { htmlRemoveId } from "../../common";
|
||||
import { IAddress } from "@/types/address.model";
|
||||
import { reactive } from "vue";
|
||||
import InlineAddress from "@/components/Address/InlineAddress.vue";
|
||||
|
||||
const address = reactive<IAddress>({
|
||||
description: "Locaux Motiv",
|
||||
street: "10 Rue Jangot",
|
||||
locality: "Lyon",
|
||||
postalCode: "69007",
|
||||
region: "Auvergne Rhône-Alpes",
|
||||
country: "France",
|
||||
type: "",
|
||||
timezone: "Europe/Dublin",
|
||||
});
|
||||
|
||||
config.global.plugins.push(Oruga);
|
||||
|
||||
let router: Router;
|
||||
|
||||
beforeEach(async () => {
|
||||
router = createRouter({
|
||||
history: createWebHistory(),
|
||||
routes: routes,
|
||||
});
|
||||
|
||||
// await router.isReady();
|
||||
});
|
||||
|
||||
const generateWrapper = (props: any = {}) => {
|
||||
const global_data = getMockClient([]);
|
||||
global_data.provide.dateFnsLocale = enUS;
|
||||
global_data.plugins = [router];
|
||||
return mount(InlineAddress, {
|
||||
props: props,
|
||||
global: {
|
||||
...global_data,
|
||||
stubs: {
|
||||
RouterLink: false,
|
||||
},
|
||||
},
|
||||
});
|
||||
};
|
||||
|
||||
describe("InlineAddress", () => {
|
||||
it("Show with locality", async () => {
|
||||
const wrapper = generateWrapper({
|
||||
physicalAddress: address,
|
||||
});
|
||||
await wrapper.vm.$nextTick();
|
||||
await flushPromises();
|
||||
expect(htmlRemoveId(wrapper.html())).toMatchSnapshot();
|
||||
});
|
||||
|
||||
it("Show without locality", async () => {
|
||||
const wrapper = generateWrapper({
|
||||
physicalAddress: { ...address, locality: null },
|
||||
});
|
||||
await wrapper.vm.$nextTick();
|
||||
await flushPromises();
|
||||
expect(htmlRemoveId(wrapper.html())).toMatchSnapshot();
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,17 @@
|
||||
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
|
||||
|
||||
exports[`AddressInfo > Show Basic 1`] = `
|
||||
"<address data-v-f169049d="" dir="auto">
|
||||
<!--v-if-->
|
||||
<p data-v-f169049d=""><span data-v-f169049d="" class="addressDescription" title="Locaux Motiv">Locaux Motiv</span><br data-v-f169049d=""><span data-v-f169049d="">10 Rue Jangot, 69007, Lyon</span><br data-v-f169049d="">
|
||||
<!--v-if-->
|
||||
</p>
|
||||
</address>"
|
||||
`;
|
||||
|
||||
exports[`AddressInfo > Show Basic with timezone 1`] = `
|
||||
"<address data-v-f169049d="" dir="auto">
|
||||
<!--v-if-->
|
||||
<p data-v-f169049d=""><span data-v-f169049d="" class="addressDescription" title="Locaux Motiv">Locaux Motiv</span><br data-v-f169049d=""><span data-v-f169049d="">10 Rue Jangot, 69007, Lyon</span><br data-v-f169049d=""><small data-v-f169049d=""> 🌐 heure moyenne de Greenwich (UTC)</small></p>
|
||||
</address>"
|
||||
`;
|
||||
@@ -0,0 +1,5 @@
|
||||
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
|
||||
|
||||
exports[`InlineAddress > Show with locality 1`] = `"<div class="truncate flex gap-1" dir="auto" title="Locaux Motiv, Lyon"><span aria-hidden="true" class="material-design-icon map-marker-icon" role="img"><svg fill="currentColor" class="material-design-icon__svg" width="24" height="24" viewBox="0 0 24 24"><path d="M12,11.5A2.5,2.5 0 0,1 9.5,9A2.5,2.5 0 0,1 12,6.5A2.5,2.5 0 0,1 14.5,9A2.5,2.5 0 0,1 12,11.5M12,2A7,7 0 0,0 5,9C5,14.25 12,22 12,22C12,22 19,14.25 19,9A7,7 0 0,0 12,2Z"><!--v-if--></path></svg></span><span>Lyon</span></div>"`;
|
||||
|
||||
exports[`InlineAddress > Show without locality 1`] = `"<div class="truncate flex gap-1" dir="auto" title="Locaux Motiv, null"><span aria-hidden="true" class="material-design-icon map-marker-icon" role="img"><svg fill="currentColor" class="material-design-icon__svg" width="24" height="24" viewBox="0 0 24 24"><path d="M12,11.5A2.5,2.5 0 0,1 9.5,9A2.5,2.5 0 0,1 12,6.5A2.5,2.5 0 0,1 14.5,9A2.5,2.5 0 0,1 12,11.5M12,2A7,7 0 0,0 5,9C5,14.25 12,22 12,22C12,22 19,14.25 19,9A7,7 0 0,0 12,2Z"><!--v-if--></path></svg></span><span>Locaux Motiv</span></div>"`;
|
||||
67
tests/unit/specs/components/Categories/CategoryCard.spec.ts
Normal file
67
tests/unit/specs/components/Categories/CategoryCard.spec.ts
Normal file
@@ -0,0 +1,67 @@
|
||||
import { beforeEach, describe, it, expect } from "vitest";
|
||||
import { enUS } from "date-fns/locale";
|
||||
import { routes } from "@/router";
|
||||
import { createRouter, createWebHistory, Router } from "vue-router";
|
||||
import { config, mount } from "@vue/test-utils";
|
||||
import { Oruga } from "@oruga-ui/oruga-next";
|
||||
import flushPromises from "flush-promises";
|
||||
import { getMockClient } from "../../mocks/client";
|
||||
import { htmlRemoveId } from "../../common";
|
||||
import CategoryCard from "@/components/Categories/CategoryCard.vue";
|
||||
import { CategoryStatsModel } from "@/types/stats.model";
|
||||
import { reactive } from "vue";
|
||||
|
||||
config.global.plugins.push(Oruga);
|
||||
|
||||
let router: Router;
|
||||
|
||||
beforeEach(async () => {
|
||||
router = createRouter({
|
||||
history: createWebHistory(),
|
||||
routes: routes,
|
||||
});
|
||||
|
||||
// await router.isReady();
|
||||
});
|
||||
|
||||
const generateWrapper = (props: any) => {
|
||||
const global_data = getMockClient([]);
|
||||
global_data.provide.dateFnsLocale = enUS;
|
||||
global_data.plugins = [router];
|
||||
return mount(CategoryCard, {
|
||||
props: props,
|
||||
global: {
|
||||
...global_data,
|
||||
stubs: {
|
||||
RouterLink: false,
|
||||
},
|
||||
},
|
||||
});
|
||||
};
|
||||
|
||||
const category = reactive<CategoryStatsModel>({
|
||||
key: "PHOTOGRAPHY",
|
||||
number: 5,
|
||||
label: "Hello",
|
||||
});
|
||||
|
||||
describe("CategoryCard", () => {
|
||||
it("Show Basic", async () => {
|
||||
const wrapper = generateWrapper({
|
||||
category: category,
|
||||
});
|
||||
await wrapper.vm.$nextTick();
|
||||
await flushPromises();
|
||||
expect(htmlRemoveId(wrapper.html())).toMatchSnapshot();
|
||||
});
|
||||
|
||||
it("Show Details", async () => {
|
||||
const wrapper = generateWrapper({
|
||||
category: { ...category, key: "OUTDOORS_ADVENTURE" },
|
||||
withDetails: true,
|
||||
});
|
||||
await wrapper.vm.$nextTick();
|
||||
await flushPromises();
|
||||
expect(htmlRemoveId(wrapper.html())).toMatchSnapshot();
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,26 @@
|
||||
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
|
||||
|
||||
exports[`CategoryCard > Show Basic 1`] = `
|
||||
"<a href="/search?categoryOneOf=PHOTOGRAPHY&contentType=EVENTS" class="max-w-xs rounded-lg overflow-hidden bg-center bg-no-repeat bg-cover shadow-lg relative group">
|
||||
<picture class="brightness-50">
|
||||
<source srcset="/img/categories/photography.webp 2x, /img/categories/photography.webp" media="(min-width: 1000px)">
|
||||
<source srcset="/img/categories/photography.webp 2x, /img/categories/photography-small.webp" media="(min-width: 300px)"><img class="w-full h-36 w-36 md:h-52 md:w-52 object-cover" src="/img/categories/photography.webp" srcset="/img/categories/photography-small.webp " width="384" height="384" alt="" loading="lazy">
|
||||
</picture>
|
||||
<div class="px-3 py-1 absolute left-0 bottom-0">
|
||||
<h2 class="group-hover:text-slate-200 font-semibold text-white tracking-tight text-xl mb-3">Hello</h2>
|
||||
</div>
|
||||
<!--v-if-->
|
||||
</a>"
|
||||
`;
|
||||
|
||||
exports[`CategoryCard > Show Details 1`] = `
|
||||
"<a href="/search?categoryOneOf=OUTDOORS_ADVENTURE&contentType=EVENTS" class="max-w-xs rounded-lg overflow-hidden bg-center bg-no-repeat bg-cover shadow-lg relative group">
|
||||
<picture class="brightness-50">
|
||||
<source srcset="/img/categories/outdoors_adventure.webp 2x, /img/categories/outdoors_adventure.webp" media="(min-width: 1000px)">
|
||||
<source srcset="/img/categories/outdoors_adventure.webp 2x, /img/categories/outdoors_adventure-small.webp" media="(min-width: 300px)"><img class="w-full h-36 w-36 md:h-52 md:w-52 object-cover" src="/img/categories/outdoors_adventure.webp" srcset="/img/categories/outdoors_adventure-small.webp " width="384" height="384" alt="" loading="lazy">
|
||||
</picture>
|
||||
<div class="px-3 py-1 absolute left-0 bottom-0">
|
||||
<h2 class="group-hover:text-slate-200 font-semibold text-white tracking-tight text-xl mb-3">Hello</h2>
|
||||
</div><span class="absolute z-10 inline-flex items-center px-3 py-1 text-xs font-semibold text-white bg-black rounded-full right-2 top-2">5 events</span>
|
||||
</a>"
|
||||
`;
|
||||
204
tests/unit/specs/components/Comment/EventComment.spec.ts
Normal file
204
tests/unit/specs/components/Comment/EventComment.spec.ts
Normal file
@@ -0,0 +1,204 @@
|
||||
import { beforeEach, describe, it, expect } from "vitest";
|
||||
import { enUS } from "date-fns/locale";
|
||||
import { routes } from "@/router";
|
||||
import { createRouter, createWebHistory, Router } from "vue-router";
|
||||
import { config, mount } from "@vue/test-utils";
|
||||
import { Oruga } from "@oruga-ui/oruga-next";
|
||||
import flushPromises from "flush-promises";
|
||||
import { getMockClient } from "../../mocks/client";
|
||||
import { htmlRemoveId } from "../../common";
|
||||
import EventComment from "@/components/Comment/EventComment.vue";
|
||||
import { IPerson } from "@/types/actor";
|
||||
import { IComment } from "@/types/comment.model";
|
||||
import {
|
||||
ActorType,
|
||||
CommentModeration,
|
||||
EventJoinOptions,
|
||||
EventStatus,
|
||||
EventVisibility,
|
||||
} from "@/types/enums";
|
||||
import { IEvent } from "@/types/event.model";
|
||||
import { reactive } from "vue";
|
||||
|
||||
config.global.plugins.push(Oruga);
|
||||
|
||||
let router: Router;
|
||||
|
||||
beforeEach(async () => {
|
||||
router = createRouter({
|
||||
history: createWebHistory(),
|
||||
routes: routes,
|
||||
});
|
||||
|
||||
// await router.isReady();
|
||||
});
|
||||
|
||||
const baseActorAvatar = {
|
||||
id: "",
|
||||
name: "",
|
||||
alt: "",
|
||||
metadata: {},
|
||||
url: "https://social.tcit.fr/system/accounts/avatars/000/000/001/original/a28c50ce5f2b13fd.jpg",
|
||||
};
|
||||
|
||||
const baseActor: IPerson = {
|
||||
name: "Thomas Citharel",
|
||||
preferredUsername: "tcit",
|
||||
avatar: baseActorAvatar,
|
||||
domain: null,
|
||||
url: "",
|
||||
summary: "",
|
||||
suspended: false,
|
||||
type: ActorType.PERSON,
|
||||
id: "598",
|
||||
};
|
||||
|
||||
const baseEvent: IEvent = {
|
||||
uuid: "an-uuid",
|
||||
title: "A very interesting event",
|
||||
description: "Things happen",
|
||||
beginsOn: new Date().toISOString(),
|
||||
endsOn: new Date().toISOString(),
|
||||
physicalAddress: {
|
||||
description: "Somewhere",
|
||||
street: "",
|
||||
locality: "",
|
||||
region: "",
|
||||
country: "",
|
||||
type: "",
|
||||
postalCode: "",
|
||||
},
|
||||
picture: {
|
||||
id: "",
|
||||
name: "",
|
||||
alt: "",
|
||||
metadata: {},
|
||||
url: "https://mobilizon.fr/media/81d9c76aaf740f84eefb28cf2b9988bdd2495ab1f3246159fd688e242155cb23.png?name=Screenshot_20220315_171848.png",
|
||||
},
|
||||
url: "",
|
||||
local: true,
|
||||
slug: "",
|
||||
publishAt: new Date().toISOString(),
|
||||
status: EventStatus.CONFIRMED,
|
||||
visibility: EventVisibility.PUBLIC,
|
||||
joinOptions: EventJoinOptions.FREE,
|
||||
draft: false,
|
||||
participantStats: {
|
||||
notApproved: 0,
|
||||
notConfirmed: 0,
|
||||
rejected: 0,
|
||||
participant: 0,
|
||||
creator: 0,
|
||||
moderator: 0,
|
||||
administrator: 0,
|
||||
going: 0,
|
||||
},
|
||||
participants: { total: 0, elements: [] },
|
||||
relatedEvents: [],
|
||||
tags: [{ slug: "something", title: "Something" }],
|
||||
attributedTo: undefined,
|
||||
organizerActor: {
|
||||
...baseActor,
|
||||
name: "Hello",
|
||||
avatar: {
|
||||
...baseActorAvatar,
|
||||
url: "https://mobilizon.fr/media/653c2dcbb830636e0db975798163b85e038dfb7713e866e96d36bd411e105e3c.png?name=festivalsanantes%27s%20avatar.png",
|
||||
},
|
||||
},
|
||||
comments: [],
|
||||
options: {
|
||||
maximumAttendeeCapacity: 0,
|
||||
remainingAttendeeCapacity: 0,
|
||||
showRemainingAttendeeCapacity: false,
|
||||
anonymousParticipation: false,
|
||||
hideOrganizerWhenGroupEvent: false,
|
||||
offers: [],
|
||||
participationConditions: [],
|
||||
attendees: [],
|
||||
program: "",
|
||||
commentModeration: CommentModeration.ALLOW_ALL,
|
||||
showParticipationPrice: false,
|
||||
showStartTime: false,
|
||||
showEndTime: false,
|
||||
timezone: null,
|
||||
isOnline: false,
|
||||
},
|
||||
metadata: [],
|
||||
contacts: [],
|
||||
language: "en",
|
||||
category: "hello",
|
||||
};
|
||||
|
||||
const event = reactive<IEvent>(baseEvent);
|
||||
|
||||
const comment = reactive<IComment>({
|
||||
text: "hello",
|
||||
local: true,
|
||||
actor: baseActor,
|
||||
totalReplies: 5,
|
||||
replies: [
|
||||
{
|
||||
text: "a reply!",
|
||||
id: "90",
|
||||
actor: baseActor,
|
||||
updatedAt: new Date().toISOString(),
|
||||
url: "http://somewhere.tld",
|
||||
replies: [],
|
||||
totalReplies: 0,
|
||||
isAnnouncement: false,
|
||||
local: false,
|
||||
},
|
||||
{
|
||||
text: "a reply to another reply!",
|
||||
id: "92",
|
||||
actor: baseActor,
|
||||
updatedAt: new Date().toISOString(),
|
||||
url: "http://somewhere.tld",
|
||||
replies: [],
|
||||
totalReplies: 0,
|
||||
isAnnouncement: false,
|
||||
local: false,
|
||||
},
|
||||
],
|
||||
isAnnouncement: false,
|
||||
updatedAt: new Date().toISOString(),
|
||||
url: "http://somewhere.tld",
|
||||
});
|
||||
|
||||
const generateWrapper = (props: any) => {
|
||||
const global_data = getMockClient([]);
|
||||
global_data.provide.dateFnsLocale = enUS;
|
||||
global_data.plugins = [router];
|
||||
return mount(EventComment, {
|
||||
props: props,
|
||||
global: {
|
||||
...global_data,
|
||||
stubs: {
|
||||
RouterLink: false,
|
||||
},
|
||||
},
|
||||
});
|
||||
};
|
||||
|
||||
describe("EventComment", () => {
|
||||
it("Show Basic", async () => {
|
||||
const wrapper = generateWrapper({
|
||||
comment: comment,
|
||||
event: event,
|
||||
currentActor: baseActor,
|
||||
});
|
||||
await wrapper.vm.$nextTick();
|
||||
await flushPromises();
|
||||
expect(htmlRemoveId(wrapper.html())).toMatchSnapshot();
|
||||
});
|
||||
it("Show Announcement", async () => {
|
||||
const wrapper = generateWrapper({
|
||||
comment: { ...comment, isAnnouncement: true },
|
||||
event: event,
|
||||
currentActor: baseActor,
|
||||
});
|
||||
await wrapper.vm.$nextTick();
|
||||
await flushPromises();
|
||||
expect(htmlRemoveId(wrapper.html())).toMatchSnapshot();
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,177 @@
|
||||
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
|
||||
|
||||
exports[`EventComment > Show Announcement 1`] = `
|
||||
"<li class="bg-white dark:bg-zinc-800 rounded p-2 bg-mbz-purple-50 dark:bg-mbz-purple-500">
|
||||
<article id="comment-undefined" dir="auto" class="mbz-comment">
|
||||
<div>
|
||||
<div class="flex items-center gap-2">
|
||||
<div class="flex items-center gap-1">
|
||||
<vmenu distance="16" triggers="hover" class="popover inline">
|
||||
<figure><img class="rounded-xl" src="https://social.tcit.fr/system/accounts/avatars/000/000/001/original/a28c50ce5f2b13fd.jpg" alt="" width="24" height="24"></figure>
|
||||
</vmenu><strong dir="auto" class="organizer">Thomas Citharel</strong>
|
||||
</div><a href="/events/an-uuid#comment-undefined"><small>in over 3 years</small></a>
|
||||
</div>
|
||||
<div dir="auto" class="prose dark:prose-invert xl:prose-lg !max-w-full text-black dark:text-white">hello</div>
|
||||
<nav class="flex gap-1 mt-1"><button class="cursor-pointer flex hover:bg-zinc-300 dark:hover:bg-zinc-600 rounded p-1"><span aria-hidden="true" class="material-design-icon reply-icon" role="img"><svg fill="currentColor" class="material-design-icon__svg" width="24" height="24" viewBox="0 0 24 24"><path d="M10,9V5L3,12L10,19V14.9C15,14.9 18.5,16.5 21,20C20,15 17,10 10,9Z"><!--v-if--></path></svg></span><span>Reply</span></button>
|
||||
<div data-oruga="dropdown" class="o-drop o-drop--position-bottom-left">
|
||||
<div tabindex="0" class="o-drop__trigger" aria-haspopup="true"><button class="cursor-pointer flex hover:bg-zinc-300 dark:hover:bg-zinc-600 rounded p-1"><span aria-hidden="true" class="material-design-icon dots-horizontal-icon" role="img"><svg fill="currentColor" class="material-design-icon__svg" width="24" height="24" viewBox="0 0 24 24"><path d="M16,12A2,2 0 0,1 18,10A2,2 0 0,1 20,12A2,2 0 0,1 18,14A2,2 0 0,1 16,12M10,12A2,2 0 0,1 12,10A2,2 0 0,1 14,12A2,2 0 0,1 12,14A2,2 0 0,1 10,12M4,12A2,2 0 0,1 6,10A2,2 0 0,1 8,12A2,2 0 0,1 6,14A2,2 0 0,1 4,12Z"><!--v-if--></path></svg></span><span class="sr-only">More options</span></button></div>
|
||||
<!--teleport start-->
|
||||
<transition-stub name="fade" appear="false" persisted="false" css="true">
|
||||
<!---->
|
||||
</transition-stub>
|
||||
<transition-stub name="fade" appear="false" persisted="false" css="true">
|
||||
<div class="o-drop__menu o-drop__menu--bottom-left" role="list" aria-hidden="true" aria-modal="true" style="display: none;">
|
||||
<div class="o-drop__item o-drop__item--clickable" role="listitem" tabindex="0" data-oruga="dropdown-item"><button class="flex items-center gap-1"><span aria-hidden="true" class="material-design-icon delete-icon" role="img"><svg fill="currentColor" class="material-design-icon__svg" width="16" height="16" viewBox="0 0 24 24"><path d="M19,4H15.5L14.5,3H9.5L8.5,4H5V6H19M6,19A2,2 0 0,0 8,21H16A2,2 0 0,0 18,19V7H6V19Z"><!--v-if--></path></svg></span><span>Delete</span></button></div>
|
||||
<div class="o-drop__item o-drop__item--clickable" role="listitem" tabindex="0" data-oruga="dropdown-item"><button class="flex items-center gap-1"><span aria-hidden="true" class="material-design-icon alert-icon" role="img"><svg fill="currentColor" class="material-design-icon__svg" width="16" height="16" viewBox="0 0 24 24"><path d="M13 14H11V9H13M13 18H11V16H13M1 21H23L12 2L1 21Z"><!--v-if--></path></svg></span><span>Report</span></button></div>
|
||||
</div>
|
||||
</transition-stub>
|
||||
<!--teleport end-->
|
||||
</div>
|
||||
</nav>
|
||||
<div class=""><button class="flex cursor-pointer hover:bg-zinc-300 dark:hover:bg-zinc-600 rounded p-1"><span aria-hidden="true" class="material-design-icon chevron-down-icon" role="img"><svg fill="currentColor" class="material-design-icon__svg" width="24" height="24" viewBox="0 0 24 24"><path d="M7.41,8.58L12,13.17L16.59,8.58L18,10L12,16L6,10L7.41,8.58Z"><!--v-if--></path></svg></span><span>View a reply</span></button></div>
|
||||
</div>
|
||||
</article>
|
||||
<form style="display: none;">
|
||||
<article class="flex gap-2">
|
||||
<figure class="mt-4"><img src="https://social.tcit.fr/system/accounts/avatars/000/000/001/original/a28c50ce5f2b13fd.jpg" alt="" width="48" height="48" class="rounded-md"></figure>
|
||||
<div class="flex-1">
|
||||
<div class="flex gap-1 items-center"><strong>Thomas Citharel</strong><small dir="ltr">@tcit</small></div>
|
||||
<div class="flex flex-col gap-2">
|
||||
<!----><button disabled="" type="submit" class="o-btn o-btn--primary o-btn--disabled self-end" role="button" data-oruga="button"><span class="o-btn__wrapper"><!----><span class="o-btn__label">Post a reply</span>
|
||||
<!----></span>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</article>
|
||||
</form>
|
||||
<!--v-if-->
|
||||
<!--teleport start-->
|
||||
<transition-stub name="zoom-out" appear="false" persisted="false" css="true">
|
||||
<div has-modal-card="" close-button-aria-label="Close" data-oruga="modal" class="o-modal" tabindex="-1" aria-modal="false" style="display: none;">
|
||||
<div class="o-modal__overlay" tabindex="-1" aria-hidden="true"></div>
|
||||
<div class="o-modal__content" style="max-width: 960px;">
|
||||
<div data-v-e0cceef3="" class="p-2">
|
||||
<header data-v-e0cceef3="" class="mb-3">
|
||||
<h2 data-v-e0cceef3="" class="text-2xl">Report this comment</h2>
|
||||
</header>
|
||||
<section data-v-e0cceef3="">
|
||||
<div data-v-e0cceef3="" class="flex gap-1 flex-row mb-3 bg-mbz-yellow dark:text-black p-3 rounded items-center"><span data-v-e0cceef3="" class="o-icon o-icon--warning hidden md:block flex-1" data-oruga="icon"><i class="mdi mdi-alert 48"></i></span>
|
||||
<p data-v-e0cceef3="">The report will be sent to the moderators of your instance. You can explain why you report this content below.</p>
|
||||
</div>
|
||||
<div data-v-e0cceef3="">
|
||||
<!--v-if-->
|
||||
<div data-v-e0cceef3="" data-oruga="field" class="o-field"><label for="additional-comments" class="o-field__label">Additional comments</label>
|
||||
<div class="o-field__body">
|
||||
<div class="o-field o-field--addons">
|
||||
<div data-v-e0cceef3="" data-oruga="input" class="o-input__wrapper o-input__wrapper--expanded"><textarea autofocus="" id="additional-comments" data-oruga-input="textarea" class="o-input o-input__textarea"></textarea>
|
||||
<!---->
|
||||
<!---->
|
||||
<!---->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!---->
|
||||
</div>
|
||||
<!--v-if-->
|
||||
</div>
|
||||
</section>
|
||||
<footer data-v-e0cceef3="" class="flex gap-2 py-3"><button data-v-e0cceef3="" type="button" class="o-btn o-btn--outlined" role="button" data-oruga="button"><span class="o-btn__wrapper"><!----><span class="o-btn__label">Cancel</span>
|
||||
<!----></span>
|
||||
</button><button data-v-e0cceef3="" type="button" class="o-btn o-btn--primary" role="button" data-oruga="button"><span class="o-btn__wrapper"><!----><span class="o-btn__label">Send the report</span>
|
||||
<!----></span>
|
||||
</button></footer>
|
||||
</div><span class="o-icon o-icon--clickable o-icon--medium o-modal__close" data-oruga="icon" style="display: none;"><i class="mdi mdi-close mdi-36px"></i></span>
|
||||
</div>
|
||||
</div>
|
||||
</transition-stub>
|
||||
<!--teleport end-->
|
||||
</li>"
|
||||
`;
|
||||
|
||||
exports[`EventComment > Show Basic 1`] = `
|
||||
"<li class="bg-white dark:bg-zinc-800 rounded p-2">
|
||||
<article id="comment-undefined" dir="auto" class="mbz-comment">
|
||||
<div>
|
||||
<div class="flex items-center gap-2">
|
||||
<div class="flex items-center gap-1">
|
||||
<vmenu distance="16" triggers="hover" class="popover inline">
|
||||
<figure><img class="rounded-xl" src="https://social.tcit.fr/system/accounts/avatars/000/000/001/original/a28c50ce5f2b13fd.jpg" alt="" width="24" height="24"></figure>
|
||||
</vmenu><strong dir="auto" class="organizer">Thomas Citharel</strong>
|
||||
</div><a href="/events/an-uuid#comment-undefined"><small>in over 3 years</small></a>
|
||||
</div>
|
||||
<div dir="auto" class="prose dark:prose-invert xl:prose-lg !max-w-full">hello</div>
|
||||
<nav class="flex gap-1 mt-1"><button class="cursor-pointer flex hover:bg-zinc-300 dark:hover:bg-zinc-600 rounded p-1"><span aria-hidden="true" class="material-design-icon reply-icon" role="img"><svg fill="currentColor" class="material-design-icon__svg" width="24" height="24" viewBox="0 0 24 24"><path d="M10,9V5L3,12L10,19V14.9C15,14.9 18.5,16.5 21,20C20,15 17,10 10,9Z"><!--v-if--></path></svg></span><span>Reply</span></button>
|
||||
<div data-oruga="dropdown" class="o-drop o-drop--position-bottom-left">
|
||||
<div tabindex="0" class="o-drop__trigger" aria-haspopup="true"><button class="cursor-pointer flex hover:bg-zinc-300 dark:hover:bg-zinc-600 rounded p-1"><span aria-hidden="true" class="material-design-icon dots-horizontal-icon" role="img"><svg fill="currentColor" class="material-design-icon__svg" width="24" height="24" viewBox="0 0 24 24"><path d="M16,12A2,2 0 0,1 18,10A2,2 0 0,1 20,12A2,2 0 0,1 18,14A2,2 0 0,1 16,12M10,12A2,2 0 0,1 12,10A2,2 0 0,1 14,12A2,2 0 0,1 12,14A2,2 0 0,1 10,12M4,12A2,2 0 0,1 6,10A2,2 0 0,1 8,12A2,2 0 0,1 6,14A2,2 0 0,1 4,12Z"><!--v-if--></path></svg></span><span class="sr-only">More options</span></button></div>
|
||||
<!--teleport start-->
|
||||
<transition-stub name="fade" appear="false" persisted="false" css="true">
|
||||
<!---->
|
||||
</transition-stub>
|
||||
<transition-stub name="fade" appear="false" persisted="false" css="true">
|
||||
<div class="o-drop__menu o-drop__menu--bottom-left" role="list" aria-hidden="true" aria-modal="true" style="display: none;">
|
||||
<div class="o-drop__item o-drop__item--clickable" role="listitem" tabindex="0" data-oruga="dropdown-item"><button class="flex items-center gap-1"><span aria-hidden="true" class="material-design-icon delete-icon" role="img"><svg fill="currentColor" class="material-design-icon__svg" width="16" height="16" viewBox="0 0 24 24"><path d="M19,4H15.5L14.5,3H9.5L8.5,4H5V6H19M6,19A2,2 0 0,0 8,21H16A2,2 0 0,0 18,19V7H6V19Z"><!--v-if--></path></svg></span><span>Delete</span></button></div>
|
||||
<div class="o-drop__item o-drop__item--clickable" role="listitem" tabindex="0" data-oruga="dropdown-item"><button class="flex items-center gap-1"><span aria-hidden="true" class="material-design-icon alert-icon" role="img"><svg fill="currentColor" class="material-design-icon__svg" width="16" height="16" viewBox="0 0 24 24"><path d="M13 14H11V9H13M13 18H11V16H13M1 21H23L12 2L1 21Z"><!--v-if--></path></svg></span><span>Report</span></button></div>
|
||||
</div>
|
||||
</transition-stub>
|
||||
<!--teleport end-->
|
||||
</div>
|
||||
</nav>
|
||||
<div class=""><button class="flex cursor-pointer hover:bg-zinc-300 dark:hover:bg-zinc-600 rounded p-1"><span aria-hidden="true" class="material-design-icon chevron-down-icon" role="img"><svg fill="currentColor" class="material-design-icon__svg" width="24" height="24" viewBox="0 0 24 24"><path d="M7.41,8.58L12,13.17L16.59,8.58L18,10L12,16L6,10L7.41,8.58Z"><!--v-if--></path></svg></span><span>View a reply</span></button></div>
|
||||
</div>
|
||||
</article>
|
||||
<form style="display: none;">
|
||||
<article class="flex gap-2">
|
||||
<figure class="mt-4"><img src="https://social.tcit.fr/system/accounts/avatars/000/000/001/original/a28c50ce5f2b13fd.jpg" alt="" width="48" height="48" class="rounded-md"></figure>
|
||||
<div class="flex-1">
|
||||
<div class="flex gap-1 items-center"><strong>Thomas Citharel</strong><small dir="ltr">@tcit</small></div>
|
||||
<div class="flex flex-col gap-2">
|
||||
<!----><button disabled="" type="submit" class="o-btn o-btn--primary o-btn--disabled self-end" role="button" data-oruga="button"><span class="o-btn__wrapper"><!----><span class="o-btn__label">Post a reply</span>
|
||||
<!----></span>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</article>
|
||||
</form>
|
||||
<!--v-if-->
|
||||
<!--teleport start-->
|
||||
<transition-stub name="zoom-out" appear="false" persisted="false" css="true">
|
||||
<div has-modal-card="" close-button-aria-label="Close" data-oruga="modal" class="o-modal" tabindex="-1" aria-modal="false" style="display: none;">
|
||||
<div class="o-modal__overlay" tabindex="-1" aria-hidden="true"></div>
|
||||
<div class="o-modal__content" style="max-width: 960px;">
|
||||
<div data-v-e0cceef3="" class="p-2">
|
||||
<header data-v-e0cceef3="" class="mb-3">
|
||||
<h2 data-v-e0cceef3="" class="text-2xl">Report this comment</h2>
|
||||
</header>
|
||||
<section data-v-e0cceef3="">
|
||||
<div data-v-e0cceef3="" class="flex gap-1 flex-row mb-3 bg-mbz-yellow dark:text-black p-3 rounded items-center"><span data-v-e0cceef3="" class="o-icon o-icon--warning hidden md:block flex-1" data-oruga="icon"><i class="mdi mdi-alert 48"></i></span>
|
||||
<p data-v-e0cceef3="">The report will be sent to the moderators of your instance. You can explain why you report this content below.</p>
|
||||
</div>
|
||||
<div data-v-e0cceef3="">
|
||||
<!--v-if-->
|
||||
<div data-v-e0cceef3="" data-oruga="field" class="o-field"><label for="additional-comments" class="o-field__label">Additional comments</label>
|
||||
<div class="o-field__body">
|
||||
<div class="o-field o-field--addons">
|
||||
<div data-v-e0cceef3="" data-oruga="input" class="o-input__wrapper o-input__wrapper--expanded"><textarea autofocus="" id="additional-comments" data-oruga-input="textarea" class="o-input o-input__textarea"></textarea>
|
||||
<!---->
|
||||
<!---->
|
||||
<!---->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!---->
|
||||
</div>
|
||||
<!--v-if-->
|
||||
</div>
|
||||
</section>
|
||||
<footer data-v-e0cceef3="" class="flex gap-2 py-3"><button data-v-e0cceef3="" type="button" class="o-btn o-btn--outlined" role="button" data-oruga="button"><span class="o-btn__wrapper"><!----><span class="o-btn__label">Cancel</span>
|
||||
<!----></span>
|
||||
</button><button data-v-e0cceef3="" type="button" class="o-btn o-btn--primary" role="button" data-oruga="button"><span class="o-btn__wrapper"><!----><span class="o-btn__label">Send the report</span>
|
||||
<!----></span>
|
||||
</button></footer>
|
||||
</div><span class="o-icon o-icon--clickable o-icon--medium o-modal__close" data-oruga="icon" style="display: none;"><i class="mdi mdi-close mdi-36px"></i></span>
|
||||
</div>
|
||||
</div>
|
||||
</transition-stub>
|
||||
<!--teleport end-->
|
||||
</li>"
|
||||
`;
|
||||
@@ -0,0 +1,96 @@
|
||||
import { beforeEach, describe, it, expect } from "vitest";
|
||||
import { enUS } from "date-fns/locale";
|
||||
import { routes } from "@/router";
|
||||
import { createRouter, createWebHistory, Router } from "vue-router";
|
||||
import { config, mount } from "@vue/test-utils";
|
||||
import { Oruga } from "@oruga-ui/oruga-next";
|
||||
import flushPromises from "flush-promises";
|
||||
import { getMockClient } from "../../mocks/client";
|
||||
import { htmlRemoveId } from "../../common";
|
||||
import DiscussionComment from "@/components/Discussion/DiscussionComment.vue";
|
||||
import { IPerson } from "@/types/actor";
|
||||
import { IComment } from "@/types/comment.model";
|
||||
import { ActorType } from "@/types/enums";
|
||||
import { reactive } from "vue";
|
||||
|
||||
config.global.plugins.push(Oruga);
|
||||
|
||||
let router: Router;
|
||||
|
||||
beforeEach(async () => {
|
||||
router = createRouter({
|
||||
history: createWebHistory(),
|
||||
routes: routes,
|
||||
});
|
||||
|
||||
// await router.isReady();
|
||||
});
|
||||
|
||||
const baseActorAvatar = {
|
||||
id: "",
|
||||
name: "",
|
||||
alt: "",
|
||||
metadata: {},
|
||||
url: "https://social.tcit.fr/system/accounts/avatars/000/000/001/original/a28c50ce5f2b13fd.jpg",
|
||||
};
|
||||
|
||||
const baseActor: IPerson = {
|
||||
name: "Thomas Citharel",
|
||||
preferredUsername: "tcit",
|
||||
avatar: baseActorAvatar,
|
||||
domain: null,
|
||||
url: "",
|
||||
summary: "",
|
||||
suspended: false,
|
||||
type: ActorType.PERSON,
|
||||
id: "598",
|
||||
};
|
||||
|
||||
const comment = reactive<IComment>({
|
||||
text: "Hello there",
|
||||
publishedAt: new Date().toString(),
|
||||
actor: baseActor,
|
||||
});
|
||||
|
||||
const deletedComment = reactive<IComment>({
|
||||
...comment,
|
||||
actor: null,
|
||||
deletedAt: new Date().toString(),
|
||||
});
|
||||
|
||||
const generateWrapper = (props: any) => {
|
||||
const global_data = getMockClient([]);
|
||||
global_data.provide.dateFnsLocale = enUS;
|
||||
global_data.plugins = [router];
|
||||
return mount(DiscussionComment, {
|
||||
props: props,
|
||||
global: {
|
||||
...global_data,
|
||||
stubs: {
|
||||
RouterLink: false,
|
||||
},
|
||||
},
|
||||
});
|
||||
};
|
||||
|
||||
describe("DiscussionComment", () => {
|
||||
it("Show Basic", async () => {
|
||||
const wrapper = generateWrapper({
|
||||
modelValue: comment,
|
||||
currentActor: baseActor,
|
||||
});
|
||||
await wrapper.vm.$nextTick();
|
||||
await flushPromises();
|
||||
expect(htmlRemoveId(wrapper.html())).toMatchSnapshot();
|
||||
});
|
||||
|
||||
it("Show Deleted comment", async () => {
|
||||
const wrapper = generateWrapper({
|
||||
modelValue: deletedComment,
|
||||
currentActor: baseActor,
|
||||
});
|
||||
await wrapper.vm.$nextTick();
|
||||
await flushPromises();
|
||||
expect(htmlRemoveId(wrapper.html())).toMatchSnapshot();
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,60 @@
|
||||
import { describe, it, expect } from "vitest";
|
||||
import { enUS } from "date-fns/locale";
|
||||
import { config, mount } from "@vue/test-utils";
|
||||
import { Oruga } from "@oruga-ui/oruga-next";
|
||||
import flushPromises from "flush-promises";
|
||||
import { getMockClient } from "../../mocks/client";
|
||||
import { htmlRemoveId } from "../../common";
|
||||
import DiscussionListItem from "@/components/Discussion/DiscussionListItem.vue";
|
||||
import { IDiscussion } from "@/types/discussions";
|
||||
import { reactive } from "vue";
|
||||
|
||||
config.global.plugins.push(Oruga);
|
||||
|
||||
const generateWrapper = (props: any) => {
|
||||
const global_data = getMockClient([]);
|
||||
global_data.provide.dateFnsLocale = enUS;
|
||||
global_data.plugins = [];
|
||||
return mount(DiscussionListItem, {
|
||||
props: props,
|
||||
global: {
|
||||
...global_data,
|
||||
},
|
||||
});
|
||||
};
|
||||
|
||||
const mockdiscussion = reactive<IDiscussion>({
|
||||
title: "A discussion",
|
||||
comments: { total: 5, elements: [] },
|
||||
insertedAt: "2022-02-02T02:04:00.000Z",
|
||||
updatedAt: "2022-02-04T02:04:00.000Z",
|
||||
deletedAt: null,
|
||||
lastComment: { text: "Hello there", publishedAt: new Date().toString() },
|
||||
});
|
||||
|
||||
const mockdiscussionWithDeletedComment = reactive<IDiscussion>({
|
||||
...mockdiscussion,
|
||||
lastComment: {
|
||||
...mockdiscussion.lastComment,
|
||||
deletedAt: "2022-02-06T02:04:00.000Z",
|
||||
},
|
||||
});
|
||||
|
||||
describe("DiscussionListItem", () => {
|
||||
it("Show Basic", async () => {
|
||||
const wrapper = generateWrapper({
|
||||
discussion: mockdiscussion,
|
||||
});
|
||||
await wrapper.vm.$nextTick();
|
||||
await flushPromises();
|
||||
expect(htmlRemoveId(wrapper.html())).toMatchSnapshot();
|
||||
});
|
||||
it("Show Deleted comment", async () => {
|
||||
const wrapper = generateWrapper({
|
||||
discussion: mockdiscussion,
|
||||
});
|
||||
await wrapper.vm.$nextTick();
|
||||
await flushPromises();
|
||||
expect(htmlRemoveId(wrapper.html())).toMatchSnapshot();
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,130 @@
|
||||
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
|
||||
|
||||
exports[`DiscussionComment > Show Basic 1`] = `
|
||||
"<article data-v-49696bef="" class="flex gap-2 bg-white dark:bg-transparent border rounded-md p-2 mt-2">
|
||||
<div data-v-49696bef="" class="">
|
||||
<figure data-v-49696bef="" class=""><img data-v-49696bef="" class="rounded-xl" src="https://social.tcit.fr/system/accounts/avatars/000/000/001/original/a28c50ce5f2b13fd.jpg" alt="" width="48" height="48"></figure>
|
||||
</div>
|
||||
<div data-v-49696bef="" class="mb-2 pt-1 flex-1">
|
||||
<div data-v-49696bef="" class="flex items-center gap-1" dir="auto">
|
||||
<div data-v-49696bef="" class="flex flex-1 flex-col"><strong data-v-49696bef="">Thomas Citharel</strong><small data-v-49696bef="">@tcit</small></div><span data-v-49696bef="" class="icons"><div data-v-49696bef="" data-oruga="dropdown" class="o-drop o-drop--position-bottom-left"><div tabindex="0" class="o-drop__trigger" aria-haspopup="true"><span data-v-49696bef="" class="cursor-pointer material-design-icon dots-horizontal-icon cursor-pointer" aria-hidden="true" role="img"><svg fill="currentColor" class="material-design-icon__svg" width="24" height="24" viewBox="0 0 24 24"><path d="M16,12A2,2 0 0,1 18,10A2,2 0 0,1 20,12A2,2 0 0,1 18,14A2,2 0 0,1 16,12M10,12A2,2 0 0,1 12,10A2,2 0 0,1 14,12A2,2 0 0,1 12,14A2,2 0 0,1 10,12M4,12A2,2 0 0,1 6,10A2,2 0 0,1 8,12A2,2 0 0,1 6,14A2,2 0 0,1 4,12Z"><!--v-if--></path></svg></span>
|
||||
</div>
|
||||
<!--teleport start-->
|
||||
<transition-stub name="fade" appear="false" persisted="false" css="true">
|
||||
<!---->
|
||||
</transition-stub>
|
||||
<transition-stub name="fade" appear="false" persisted="false" css="true">
|
||||
<div class="o-drop__menu o-drop__menu--bottom-left" role="list" aria-hidden="true" aria-modal="true" style="display: none;">
|
||||
<div data-v-49696bef="" class="o-drop__item o-drop__item--clickable" role="menuitem" tabindex="0" data-oruga="dropdown-item"><span data-v-49696bef="" class="o-icon" data-oruga="icon"><i class="mdi mdi-pencil mdi-24px"></i></span> Edit</div>
|
||||
<div data-v-49696bef="" class="o-drop__item o-drop__item--clickable" role="menuitem" tabindex="0" data-oruga="dropdown-item"><span data-v-49696bef="" class="o-icon" data-oruga="icon"><i class="mdi mdi-delete mdi-24px"></i></span> Delete</div>
|
||||
<!--v-if-->
|
||||
</div>
|
||||
</transition-stub>
|
||||
<!--teleport end-->
|
||||
</div></span>
|
||||
<div data-v-49696bef="" class="self-center">
|
||||
<!--v-if-->
|
||||
</div>
|
||||
</div>
|
||||
<div data-v-49696bef="" class="text-wrapper" dir="auto">
|
||||
<div data-v-49696bef="" class="prose md:prose-lg lg:prose-xl dark:prose-invert">Hello there</div>
|
||||
<!--v-if-->
|
||||
</div>
|
||||
</div>
|
||||
</article>
|
||||
<!--teleport start-->
|
||||
<transition-stub name="zoom-out" appear="false" persisted="false" css="true">
|
||||
<div has-modal-card="" close-button-aria-label="Close" data-oruga="modal" class="o-modal" tabindex="-1" aria-modal="false" style="display: none;">
|
||||
<div class="o-modal__overlay" tabindex="-1" aria-hidden="true"></div>
|
||||
<div class="o-modal__content" style="max-width: 960px;">
|
||||
<div data-v-e0cceef3="" data-v-49696bef="" class="p-2">
|
||||
<header data-v-e0cceef3="" class="mb-3">
|
||||
<h2 data-v-e0cceef3="" class="text-2xl">Report this comment</h2>
|
||||
</header>
|
||||
<section data-v-e0cceef3="">
|
||||
<div data-v-e0cceef3="" class="flex gap-1 flex-row mb-3 bg-mbz-yellow dark:text-black p-3 rounded items-center"><span data-v-e0cceef3="" class="o-icon o-icon--warning hidden md:block flex-1" data-oruga="icon"><i class="mdi mdi-alert 48"></i></span>
|
||||
<p data-v-e0cceef3="">The report will be sent to the moderators of your instance. You can explain why you report this content below.</p>
|
||||
</div>
|
||||
<div data-v-e0cceef3="">
|
||||
<!--v-if-->
|
||||
<div data-v-e0cceef3="" data-oruga="field" class="o-field"><label for="additional-comments" class="o-field__label">Additional comments</label>
|
||||
<div class="o-field__body">
|
||||
<div class="o-field o-field--addons">
|
||||
<div data-v-e0cceef3="" data-oruga="input" class="o-input__wrapper o-input__wrapper--expanded"><textarea autofocus="" id="additional-comments" data-oruga-input="textarea" class="o-input o-input__textarea"></textarea>
|
||||
<!---->
|
||||
<!---->
|
||||
<!---->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!---->
|
||||
</div>
|
||||
<!--v-if-->
|
||||
</div>
|
||||
</section>
|
||||
<footer data-v-e0cceef3="" class="flex gap-2 py-3"><button data-v-e0cceef3="" type="button" class="o-btn o-btn--outlined" role="button" data-oruga="button"><span class="o-btn__wrapper"><!----><span class="o-btn__label">Cancel</span>
|
||||
<!----></span>
|
||||
</button><button data-v-e0cceef3="" type="button" class="o-btn o-btn--primary" role="button" data-oruga="button"><span class="o-btn__wrapper"><!----><span class="o-btn__label">Send the report</span>
|
||||
<!----></span>
|
||||
</button></footer>
|
||||
</div><span class="o-icon o-icon--clickable o-icon--medium o-modal__close" data-oruga="icon" style="display: none;"><i class="mdi mdi-close mdi-36px"></i></span>
|
||||
</div>
|
||||
</div>
|
||||
</transition-stub>
|
||||
<!--teleport end-->"
|
||||
`;
|
||||
|
||||
exports[`DiscussionComment > Show Deleted comment 1`] = `
|
||||
"<article data-v-49696bef="" class="flex gap-2 bg-white dark:bg-transparent border rounded-md p-2 mt-2">
|
||||
<div data-v-49696bef="" class=""><span data-v-49696bef="" aria-hidden="true" class="material-design-icon account-circle-icon" role="img"><svg fill="currentColor" class="material-design-icon__svg" width="48" height="48" viewBox="0 0 24 24"><path d="M12,19.2C9.5,19.2 7.29,17.92 6,16C6.03,14 10,12.9 12,12.9C14,12.9 17.97,14 18,16C16.71,17.92 14.5,19.2 12,19.2M12,5A3,3 0 0,1 15,8A3,3 0 0,1 12,11A3,3 0 0,1 9,8A3,3 0 0,1 12,5M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12C22,6.47 17.5,2 12,2Z"><!--v-if--></path></svg></span></div>
|
||||
<div data-v-49696bef="" class="mb-2 pt-1 flex-1">
|
||||
<div data-v-49696bef="" class="flex items-center gap-1" dir="auto"><span data-v-49696bef="" class="name comment-link has-text-grey">[deleted]</span>
|
||||
<!--v-if-->
|
||||
<div data-v-49696bef="" class="self-center">
|
||||
<!--v-if-->
|
||||
</div>
|
||||
</div>
|
||||
<div data-v-49696bef="" class="comment-deleted">[This comment has been deleted by it's author]</div>
|
||||
</div>
|
||||
</article>
|
||||
<!--teleport start-->
|
||||
<transition-stub name="zoom-out" appear="false" persisted="false" css="true">
|
||||
<div has-modal-card="" close-button-aria-label="Close" data-oruga="modal" class="o-modal" tabindex="-1" aria-modal="false" style="display: none;">
|
||||
<div class="o-modal__overlay" tabindex="-1" aria-hidden="true"></div>
|
||||
<div class="o-modal__content" style="max-width: 960px;">
|
||||
<div data-v-e0cceef3="" data-v-49696bef="" class="p-2">
|
||||
<header data-v-e0cceef3="" class="mb-3">
|
||||
<h2 data-v-e0cceef3="" class="text-2xl">Report this comment</h2>
|
||||
</header>
|
||||
<section data-v-e0cceef3="">
|
||||
<div data-v-e0cceef3="" class="flex gap-1 flex-row mb-3 bg-mbz-yellow dark:text-black p-3 rounded items-center"><span data-v-e0cceef3="" class="o-icon o-icon--warning hidden md:block flex-1" data-oruga="icon"><i class="mdi mdi-alert 48"></i></span>
|
||||
<p data-v-e0cceef3="">The report will be sent to the moderators of your instance. You can explain why you report this content below.</p>
|
||||
</div>
|
||||
<div data-v-e0cceef3="">
|
||||
<!--v-if-->
|
||||
<div data-v-e0cceef3="" data-oruga="field" class="o-field"><label for="additional-comments" class="o-field__label">Additional comments</label>
|
||||
<div class="o-field__body">
|
||||
<div class="o-field o-field--addons">
|
||||
<div data-v-e0cceef3="" data-oruga="input" class="o-input__wrapper o-input__wrapper--expanded"><textarea autofocus="" id="additional-comments" data-oruga-input="textarea" class="o-input o-input__textarea"></textarea>
|
||||
<!---->
|
||||
<!---->
|
||||
<!---->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!---->
|
||||
</div>
|
||||
<!--v-if-->
|
||||
</div>
|
||||
</section>
|
||||
<footer data-v-e0cceef3="" class="flex gap-2 py-3"><button data-v-e0cceef3="" type="button" class="o-btn o-btn--outlined" role="button" data-oruga="button"><span class="o-btn__wrapper"><!----><span class="o-btn__label">Cancel</span>
|
||||
<!----></span>
|
||||
</button><button data-v-e0cceef3="" type="button" class="o-btn o-btn--primary" role="button" data-oruga="button"><span class="o-btn__wrapper"><!----><span class="o-btn__label">Send the report</span>
|
||||
<!----></span>
|
||||
</button></footer>
|
||||
</div><span class="o-icon o-icon--clickable o-icon--medium o-modal__close" data-oruga="icon" style="display: none;"><i class="mdi mdi-close mdi-36px"></i></span>
|
||||
</div>
|
||||
</div>
|
||||
</transition-stub>
|
||||
<!--teleport end-->"
|
||||
`;
|
||||
@@ -0,0 +1,25 @@
|
||||
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
|
||||
|
||||
exports[`DiscussionListItem > Show Basic 1`] = `
|
||||
"<router-link class="flex gap-1 w-full items-center p-2 border-b-stone-200 border-b bg-white dark:bg-transparent" dir="auto" to="[object Object]">
|
||||
<div class=""><span aria-hidden="true" class="material-design-icon account-circle-icon" role="img"><svg fill="currentColor" class="material-design-icon__svg" width="32" height="32" viewBox="0 0 24 24"><path d="M12,19.2C9.5,19.2 7.29,17.92 6,16C6.03,14 10,12.9 12,12.9C14,12.9 17.97,14 18,16C16.71,17.92 14.5,19.2 12,19.2M12,5A3,3 0 0,1 15,8A3,3 0 0,1 12,11A3,3 0 0,1 9,8A3,3 0 0,1 12,5M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12C22,6.47 17.5,2 12,2Z"><!--v-if--></path></svg></span></div>
|
||||
<div class="flex-1">
|
||||
<div class="flex items-center">
|
||||
<p class="text-violet-3 dark:text-white text-lg font-semibold flex-1">A discussion</p><span class="" title="Friday, February 4, 2022 at 3:04 AM">2 days</span>
|
||||
</div>
|
||||
<div class="line-clamp-2" dir="auto"></div>
|
||||
</div>
|
||||
</router-link>"
|
||||
`;
|
||||
|
||||
exports[`DiscussionListItem > Show Deleted comment 1`] = `
|
||||
"<router-link class="flex gap-1 w-full items-center p-2 border-b-stone-200 border-b bg-white dark:bg-transparent" dir="auto" to="[object Object]">
|
||||
<div class=""><span aria-hidden="true" class="material-design-icon account-circle-icon" role="img"><svg fill="currentColor" class="material-design-icon__svg" width="32" height="32" viewBox="0 0 24 24"><path d="M12,19.2C9.5,19.2 7.29,17.92 6,16C6.03,14 10,12.9 12,12.9C14,12.9 17.97,14 18,16C16.71,17.92 14.5,19.2 12,19.2M12,5A3,3 0 0,1 15,8A3,3 0 0,1 12,11A3,3 0 0,1 9,8A3,3 0 0,1 12,5M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12C22,6.47 17.5,2 12,2Z"><!--v-if--></path></svg></span></div>
|
||||
<div class="flex-1">
|
||||
<div class="flex items-center">
|
||||
<p class="text-violet-3 dark:text-white text-lg font-semibold flex-1">A discussion</p><span class="" title="Friday, February 4, 2022 at 3:04 AM">2 days</span>
|
||||
</div>
|
||||
<div class="line-clamp-2" dir="auto"></div>
|
||||
</div>
|
||||
</router-link>"
|
||||
`;
|
||||
59
tests/unit/specs/components/Event/DateCalendarIcon.spec.ts
Normal file
59
tests/unit/specs/components/Event/DateCalendarIcon.spec.ts
Normal file
@@ -0,0 +1,59 @@
|
||||
import { beforeEach, describe, it, expect } from "vitest";
|
||||
import { enUS } from "date-fns/locale";
|
||||
import { routes } from "@/router";
|
||||
import { createRouter, createWebHistory, Router } from "vue-router";
|
||||
import { config, mount } from "@vue/test-utils";
|
||||
import { Oruga } from "@oruga-ui/oruga-next";
|
||||
import flushPromises from "flush-promises";
|
||||
import { getMockClient } from "../../mocks/client";
|
||||
import { htmlRemoveId } from "../../common";
|
||||
import DateCalendarIcon from "@/components/Event/DateCalendarIcon.vue";
|
||||
|
||||
config.global.plugins.push(Oruga);
|
||||
|
||||
let router: Router;
|
||||
|
||||
beforeEach(async () => {
|
||||
router = createRouter({
|
||||
history: createWebHistory(),
|
||||
routes: routes,
|
||||
});
|
||||
|
||||
// await router.isReady();
|
||||
});
|
||||
|
||||
const generateWrapper = (props: any) => {
|
||||
const global_data = getMockClient([]);
|
||||
global_data.provide.dateFnsLocale = enUS;
|
||||
global_data.plugins = [router];
|
||||
return mount(DateCalendarIcon, {
|
||||
props: props,
|
||||
global: {
|
||||
...global_data,
|
||||
stubs: {
|
||||
RouterLink: false,
|
||||
},
|
||||
},
|
||||
});
|
||||
};
|
||||
|
||||
describe("DateCalendarIcon", () => {
|
||||
it("Show new", async () => {
|
||||
const wrapper = generateWrapper({
|
||||
date: new Date().toString(),
|
||||
});
|
||||
await wrapper.vm.$nextTick();
|
||||
await flushPromises();
|
||||
expect(htmlRemoveId(wrapper.html())).toMatchSnapshot();
|
||||
});
|
||||
|
||||
it("Show small", async () => {
|
||||
const wrapper = generateWrapper({
|
||||
date: new Date().toString(),
|
||||
small: true,
|
||||
});
|
||||
await wrapper.vm.$nextTick();
|
||||
await flushPromises();
|
||||
expect(htmlRemoveId(wrapper.html())).toMatchSnapshot();
|
||||
});
|
||||
});
|
||||
219
tests/unit/specs/components/Event/EventCard.spec.ts
Normal file
219
tests/unit/specs/components/Event/EventCard.spec.ts
Normal file
@@ -0,0 +1,219 @@
|
||||
import { beforeEach, describe, it, expect, vi } from "vitest";
|
||||
import { enUS } from "date-fns/locale";
|
||||
import { routes } from "@/router";
|
||||
import { createRouter, createWebHistory, Router } from "vue-router";
|
||||
import { config, mount } from "@vue/test-utils";
|
||||
import { Oruga } from "@oruga-ui/oruga-next";
|
||||
import flushPromises from "flush-promises";
|
||||
import { getMockClient } from "../../mocks/client";
|
||||
import { htmlRemoveId } from "../../common";
|
||||
import EventCard from "@/components/Event/EventCard.vue";
|
||||
import { IActor } from "@/types/actor";
|
||||
import {
|
||||
ActorType,
|
||||
CommentModeration,
|
||||
EventJoinOptions,
|
||||
EventStatus,
|
||||
EventVisibility,
|
||||
} from "@/types/enums";
|
||||
import { IEvent } from "@/types/event.model";
|
||||
import { reactive } from "vue";
|
||||
|
||||
config.global.plugins.push(Oruga);
|
||||
|
||||
let router: Router;
|
||||
|
||||
class MockIntersectionObserver implements IntersectionObserver {
|
||||
root: Document | Element | null = null;
|
||||
rootMargin: string = ``;
|
||||
thresholds: readonly number[] = [];
|
||||
|
||||
disconnect = vi.fn();
|
||||
observe = vi.fn();
|
||||
takeRecords = vi.fn();
|
||||
unobserve = vi.fn();
|
||||
}
|
||||
window.IntersectionObserver = MockIntersectionObserver;
|
||||
|
||||
beforeEach(async () => {
|
||||
router = createRouter({
|
||||
history: createWebHistory(),
|
||||
routes: routes,
|
||||
});
|
||||
});
|
||||
|
||||
const generateWrapper = (props: any) => {
|
||||
const global_data = getMockClient([]);
|
||||
global_data.provide.dateFnsLocale = enUS;
|
||||
global_data.plugins = [router];
|
||||
return mount(EventCard, {
|
||||
props: props,
|
||||
global: {
|
||||
...global_data,
|
||||
stubs: {
|
||||
RouterLink: false,
|
||||
},
|
||||
},
|
||||
});
|
||||
};
|
||||
|
||||
const baseActorAvatar = {
|
||||
id: "",
|
||||
name: "",
|
||||
alt: "",
|
||||
metadata: {},
|
||||
url: "https://social.tcit.fr/system/accounts/avatars/000/000/001/original/a28c50ce5f2b13fd.jpg",
|
||||
};
|
||||
|
||||
const baseActor: IActor = {
|
||||
name: "Thomas Citharel",
|
||||
preferredUsername: "tcit",
|
||||
avatar: baseActorAvatar,
|
||||
domain: null,
|
||||
url: "",
|
||||
summary: "",
|
||||
suspended: false,
|
||||
type: ActorType.PERSON,
|
||||
};
|
||||
|
||||
const baseEvent: IEvent = {
|
||||
uuid: "0123456789",
|
||||
title: "A very interesting event",
|
||||
description: "Things happen",
|
||||
beginsOn: "2022-02-02T02:04:00.000Z",
|
||||
endsOn: "2022-02-02T02:04:00.000Z",
|
||||
physicalAddress: {
|
||||
description: "Somewhere",
|
||||
street: "",
|
||||
locality: "",
|
||||
region: "",
|
||||
country: "",
|
||||
type: "",
|
||||
postalCode: "",
|
||||
},
|
||||
picture: {
|
||||
id: "",
|
||||
name: "",
|
||||
alt: "",
|
||||
metadata: {},
|
||||
url: "https://mobilizon.fr/media/81d9c76aaf740f84eefb28cf2b9988bdd2495ab1f3246159fd688e242155cb23.png?name=Screenshot_20220315_171848.png",
|
||||
},
|
||||
url: "",
|
||||
local: true,
|
||||
slug: "",
|
||||
publishAt: new Date().toISOString(),
|
||||
status: EventStatus.CONFIRMED,
|
||||
visibility: EventVisibility.PUBLIC,
|
||||
joinOptions: EventJoinOptions.FREE,
|
||||
draft: false,
|
||||
participantStats: {
|
||||
notApproved: 0,
|
||||
notConfirmed: 0,
|
||||
rejected: 0,
|
||||
participant: 0,
|
||||
creator: 0,
|
||||
moderator: 0,
|
||||
administrator: 0,
|
||||
going: 0,
|
||||
},
|
||||
participants: { total: 0, elements: [] },
|
||||
relatedEvents: [],
|
||||
tags: [{ slug: "something", title: "Something" }],
|
||||
attributedTo: undefined,
|
||||
organizerActor: {
|
||||
...baseActor,
|
||||
name: "Hello",
|
||||
avatar: {
|
||||
...baseActorAvatar,
|
||||
url: "https://mobilizon.fr/media/653c2dcbb830636e0db975798163b85e038dfb7713e866e96d36bd411e105e3c.png?name=festivalsanantes%27s%20avatar.png",
|
||||
},
|
||||
},
|
||||
comments: [],
|
||||
options: {
|
||||
maximumAttendeeCapacity: 0,
|
||||
remainingAttendeeCapacity: 0,
|
||||
showRemainingAttendeeCapacity: false,
|
||||
anonymousParticipation: false,
|
||||
hideOrganizerWhenGroupEvent: false,
|
||||
offers: [],
|
||||
participationConditions: [],
|
||||
attendees: [],
|
||||
program: "",
|
||||
commentModeration: CommentModeration.ALLOW_ALL,
|
||||
showParticipationPrice: false,
|
||||
showStartTime: false,
|
||||
showEndTime: false,
|
||||
timezone: null,
|
||||
isOnline: false,
|
||||
},
|
||||
metadata: [],
|
||||
contacts: [],
|
||||
language: "en",
|
||||
category: "hello",
|
||||
};
|
||||
|
||||
const event = reactive<IEvent>(baseEvent);
|
||||
|
||||
const longEvent = reactive<IEvent>({
|
||||
...baseEvent,
|
||||
title:
|
||||
"A very long title that will have trouble to display because it will take multiple lines but where will it stop ?! Maybe after 3 lines is enough. Let's say so. But if it doesn't work, we really need to truncate it at some point. Definitively.",
|
||||
});
|
||||
|
||||
const tentativeEvent = reactive<IEvent>({
|
||||
...baseEvent,
|
||||
status: EventStatus.TENTATIVE,
|
||||
});
|
||||
|
||||
const cancelledEvent = reactive<IEvent>({
|
||||
...baseEvent,
|
||||
status: EventStatus.CANCELLED,
|
||||
});
|
||||
|
||||
describe("EventCard", () => {
|
||||
it("Show default", async () => {
|
||||
const wrapper = generateWrapper({
|
||||
event: event,
|
||||
});
|
||||
await wrapper.vm.$nextTick();
|
||||
await flushPromises();
|
||||
expect(htmlRemoveId(wrapper.html())).toMatchSnapshot();
|
||||
});
|
||||
|
||||
it("Show long", async () => {
|
||||
const wrapper = generateWrapper({
|
||||
event: longEvent,
|
||||
});
|
||||
await wrapper.vm.$nextTick();
|
||||
await flushPromises();
|
||||
expect(htmlRemoveId(wrapper.html())).toMatchSnapshot();
|
||||
});
|
||||
|
||||
it("Show tentative", async () => {
|
||||
const wrapper = generateWrapper({
|
||||
event: tentativeEvent,
|
||||
});
|
||||
await wrapper.vm.$nextTick();
|
||||
await flushPromises();
|
||||
expect(htmlRemoveId(wrapper.html())).toMatchSnapshot();
|
||||
});
|
||||
|
||||
it("Show cancelled", async () => {
|
||||
const wrapper = generateWrapper({
|
||||
event: cancelledEvent,
|
||||
});
|
||||
await wrapper.vm.$nextTick();
|
||||
await flushPromises();
|
||||
expect(htmlRemoveId(wrapper.html())).toMatchSnapshot();
|
||||
});
|
||||
|
||||
it("Show Row mode", async () => {
|
||||
const wrapper = generateWrapper({
|
||||
event: longEvent,
|
||||
mode: "row",
|
||||
});
|
||||
await wrapper.vm.$nextTick();
|
||||
await flushPromises();
|
||||
expect(htmlRemoveId(wrapper.html())).toMatchSnapshot();
|
||||
});
|
||||
});
|
||||
169
tests/unit/specs/components/Event/EventListViewCard.spec.ts
Normal file
169
tests/unit/specs/components/Event/EventListViewCard.spec.ts
Normal file
@@ -0,0 +1,169 @@
|
||||
import { beforeEach, describe, it, expect } from "vitest";
|
||||
import { enUS } from "date-fns/locale";
|
||||
import { routes } from "@/router";
|
||||
import { createRouter, createWebHistory, Router } from "vue-router";
|
||||
import { config, mount } from "@vue/test-utils";
|
||||
import { Oruga } from "@oruga-ui/oruga-next";
|
||||
import flushPromises from "flush-promises";
|
||||
import { getMockClient } from "../../mocks/client";
|
||||
import { htmlRemoveId } from "../../common";
|
||||
import EventListViewCard from "@/components/Event/EventListViewCard.vue";
|
||||
import { IActor } from "@/types/actor";
|
||||
import {
|
||||
ActorType,
|
||||
CommentModeration,
|
||||
EventJoinOptions,
|
||||
EventStatus,
|
||||
EventVisibility,
|
||||
} from "@/types/enums";
|
||||
import { IEvent } from "@/types/event.model";
|
||||
import { reactive } from "vue";
|
||||
|
||||
config.global.plugins.push(Oruga);
|
||||
|
||||
let router: Router;
|
||||
|
||||
beforeEach(async () => {
|
||||
router = createRouter({
|
||||
history: createWebHistory(),
|
||||
routes: routes,
|
||||
});
|
||||
|
||||
// await router.isReady();
|
||||
});
|
||||
|
||||
const generateWrapper = (props: any) => {
|
||||
const global_data = getMockClient([]);
|
||||
global_data.provide.dateFnsLocale = enUS;
|
||||
global_data.plugins = [router];
|
||||
return mount(EventListViewCard, {
|
||||
props: props,
|
||||
global: {
|
||||
...global_data,
|
||||
stubs: {
|
||||
RouterLink: false,
|
||||
},
|
||||
},
|
||||
});
|
||||
};
|
||||
|
||||
const baseActorAvatar = {
|
||||
id: "",
|
||||
name: "",
|
||||
alt: "",
|
||||
metadata: {},
|
||||
url: "https://social.tcit.fr/system/accounts/avatars/000/000/001/original/a28c50ce5f2b13fd.jpg",
|
||||
};
|
||||
|
||||
const baseActor: IActor = {
|
||||
name: "Thomas Citharel",
|
||||
preferredUsername: "tcit",
|
||||
avatar: baseActorAvatar,
|
||||
domain: null,
|
||||
url: "",
|
||||
summary: "",
|
||||
suspended: false,
|
||||
type: ActorType.PERSON,
|
||||
};
|
||||
|
||||
const baseEvent: IEvent = {
|
||||
uuid: "0123456789",
|
||||
title: "A very interesting event",
|
||||
description: "Things happen",
|
||||
beginsOn: "2022-02-02T02:04:00.000Z",
|
||||
endsOn: "2022-02-04T02:04:00.000Z",
|
||||
physicalAddress: {
|
||||
description: "Somewhere",
|
||||
street: "",
|
||||
locality: "",
|
||||
region: "",
|
||||
country: "",
|
||||
type: "",
|
||||
postalCode: "",
|
||||
},
|
||||
picture: {
|
||||
id: "",
|
||||
name: "",
|
||||
alt: "",
|
||||
metadata: {},
|
||||
url: "https://mobilizon.fr/media/81d9c76aaf740f84eefb28cf2b9988bdd2495ab1f3246159fd688e242155cb23.png?name=Screenshot_20220315_171848.png",
|
||||
},
|
||||
url: "",
|
||||
local: true,
|
||||
slug: "",
|
||||
publishAt: "2022-02-02T02:04:00.000Z",
|
||||
status: EventStatus.CONFIRMED,
|
||||
visibility: EventVisibility.PUBLIC,
|
||||
joinOptions: EventJoinOptions.FREE,
|
||||
draft: false,
|
||||
participantStats: {
|
||||
notApproved: 0,
|
||||
notConfirmed: 0,
|
||||
rejected: 0,
|
||||
participant: 0,
|
||||
creator: 0,
|
||||
moderator: 0,
|
||||
administrator: 0,
|
||||
going: 0,
|
||||
},
|
||||
participants: { total: 0, elements: [] },
|
||||
relatedEvents: [],
|
||||
tags: [{ slug: "something", title: "Something" }],
|
||||
attributedTo: undefined,
|
||||
organizerActor: {
|
||||
...baseActor,
|
||||
name: "Hello",
|
||||
avatar: {
|
||||
...baseActorAvatar,
|
||||
url: "https://mobilizon.fr/media/653c2dcbb830636e0db975798163b85e038dfb7713e866e96d36bd411e105e3c.png?name=festivalsanantes%27s%20avatar.png",
|
||||
},
|
||||
},
|
||||
comments: [],
|
||||
options: {
|
||||
maximumAttendeeCapacity: 0,
|
||||
remainingAttendeeCapacity: 0,
|
||||
showRemainingAttendeeCapacity: false,
|
||||
anonymousParticipation: false,
|
||||
hideOrganizerWhenGroupEvent: false,
|
||||
offers: [],
|
||||
participationConditions: [],
|
||||
attendees: [],
|
||||
program: "",
|
||||
commentModeration: CommentModeration.ALLOW_ALL,
|
||||
showParticipationPrice: false,
|
||||
showStartTime: false,
|
||||
showEndTime: false,
|
||||
timezone: null,
|
||||
isOnline: false,
|
||||
},
|
||||
metadata: [],
|
||||
contacts: [],
|
||||
language: "en",
|
||||
category: "hello",
|
||||
};
|
||||
|
||||
const longEvent = reactive<IEvent>({
|
||||
...baseEvent,
|
||||
title:
|
||||
"A very long title that will have trouble to display because it will take multiple lines but where will it stop ?! Maybe after 3 lines is enough. Let's say so.",
|
||||
});
|
||||
|
||||
describe("EventListViewCard", () => {
|
||||
it("Show default", async () => {
|
||||
const wrapper = generateWrapper({
|
||||
event: baseEvent,
|
||||
});
|
||||
await wrapper.vm.$nextTick();
|
||||
await flushPromises();
|
||||
expect(htmlRemoveId(wrapper.html())).toMatchSnapshot();
|
||||
});
|
||||
|
||||
it("Show long", async () => {
|
||||
const wrapper = generateWrapper({
|
||||
event: longEvent,
|
||||
});
|
||||
await wrapper.vm.$nextTick();
|
||||
await flushPromises();
|
||||
expect(htmlRemoveId(wrapper.html())).toMatchSnapshot();
|
||||
});
|
||||
});
|
||||
@@ -5,11 +5,11 @@ import { createRouter, createWebHistory, Router } from "vue-router";
|
||||
import { config, mount } from "@vue/test-utils";
|
||||
import { Oruga } from "@oruga-ui/oruga-next";
|
||||
import flushPromises from "flush-promises";
|
||||
import { getMockClient, requestHandlers } from "../../mocks/client";
|
||||
import { getMockClient } from "../../mocks/client";
|
||||
import { htmlRemoveId } from "../../common";
|
||||
import GroupSettings from "@/views/Group/GroupSettings.vue";
|
||||
import { FETCH_GROUP_PUBLIC } from "@/graphql/group";
|
||||
import { DELETE_GROUP } from "@/graphql/group";
|
||||
import OrganizerPicker from "@/components/Event/OrganizerPicker.vue";
|
||||
import { reactive, ref } from "vue";
|
||||
import { ActorType } from "@/types/enums";
|
||||
|
||||
config.global.plugins.push(Oruga);
|
||||
|
||||
@@ -24,13 +24,40 @@ beforeEach(async () => {
|
||||
// await router.isReady();
|
||||
});
|
||||
|
||||
const currentActor = reactive({
|
||||
id: "59",
|
||||
preferredUsername: "me",
|
||||
name: "Someone",
|
||||
type: ActorType.PERSON,
|
||||
});
|
||||
|
||||
const actor = reactive({
|
||||
id: "5",
|
||||
preferredUsername: "hello",
|
||||
name: "Sigmund",
|
||||
type: ActorType.PERSON,
|
||||
});
|
||||
|
||||
const group = reactive({
|
||||
id: "89",
|
||||
preferredUsername: "congregation",
|
||||
name: "College",
|
||||
type: ActorType.GROUP,
|
||||
});
|
||||
|
||||
const identities = [actor, group];
|
||||
|
||||
const generateWrapper = () => {
|
||||
const global_data = getMockClient([FETCH_GROUP_PUBLIC, DELETE_GROUP]);
|
||||
const global_data = getMockClient([]);
|
||||
global_data.provide.dateFnsLocale = enUS;
|
||||
global_data.plugins = [router];
|
||||
return mount(GroupSettings, {
|
||||
return mount(OrganizerPicker, {
|
||||
props: {
|
||||
preferredUsername: "my-group",
|
||||
modelValue: actor,
|
||||
identities: identities,
|
||||
actorFilter: "",
|
||||
groupMemberships: [],
|
||||
currentActor: currentActor,
|
||||
},
|
||||
global: {
|
||||
...global_data,
|
||||
@@ -41,16 +68,11 @@ const generateWrapper = () => {
|
||||
});
|
||||
};
|
||||
|
||||
describe("GroupSettings", () => {
|
||||
describe("OrganizerPicker", () => {
|
||||
it("Show simple", async () => {
|
||||
const wrapper = generateWrapper();
|
||||
await wrapper.vm.$nextTick();
|
||||
await flushPromises();
|
||||
expect(htmlRemoveId(wrapper.html())).toMatchSnapshot();
|
||||
expect(requestHandlers.handle_0).toHaveBeenCalledTimes(1);
|
||||
expect(requestHandlers.handle_1).toHaveBeenCalledTimes(0);
|
||||
expect(requestHandlers.handle_0).toHaveBeenCalledWith({
|
||||
name: "my-group",
|
||||
});
|
||||
});
|
||||
});
|
||||
@@ -7,14 +7,9 @@ import { Oruga } from "@oruga-ui/oruga-next";
|
||||
import flushPromises from "flush-promises";
|
||||
import { getMockClient, requestHandlers } from "../../mocks/client";
|
||||
import { htmlRemoveId } from "../../common";
|
||||
import GroupMembers from "@/views/Group/GroupMembers.vue";
|
||||
import {
|
||||
INVITE_MEMBER,
|
||||
GROUP_MEMBERS,
|
||||
REMOVE_MEMBER,
|
||||
UPDATE_MEMBER,
|
||||
APPROVE_MEMBER,
|
||||
} from "@/graphql/member";
|
||||
import OrganizerPickerWrapper from "@/components/Event/OrganizerPickerWrapper.vue";
|
||||
import { PERSON_GROUP_MEMBERSHIPS } from "@/graphql/actor";
|
||||
import { IDENTITIES } from "@/graphql/actor";
|
||||
|
||||
config.global.plugins.push(Oruga);
|
||||
|
||||
@@ -29,19 +24,33 @@ beforeEach(async () => {
|
||||
// await router.isReady();
|
||||
});
|
||||
|
||||
const mock_person = {
|
||||
data: {
|
||||
person: { id: "5", memberships: { total: 0, elements: [] } },
|
||||
},
|
||||
};
|
||||
const mock_loggeduser = {
|
||||
data: {
|
||||
loggedUser: {
|
||||
actors: [{ id: "9", preferredUsername: "sam", name: "Samuel" }],
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
const generateWrapper = () => {
|
||||
const global_data = getMockClient([
|
||||
INVITE_MEMBER,
|
||||
GROUP_MEMBERS,
|
||||
REMOVE_MEMBER,
|
||||
UPDATE_MEMBER,
|
||||
APPROVE_MEMBER,
|
||||
[PERSON_GROUP_MEMBERSHIPS, mock_person],
|
||||
[IDENTITIES, mock_loggeduser],
|
||||
]);
|
||||
global_data.provide.dateFnsLocale = enUS;
|
||||
global_data.plugins = [router];
|
||||
return mount(GroupMembers, {
|
||||
return mount(OrganizerPickerWrapper, {
|
||||
props: {
|
||||
preferredUsername: "my-group",
|
||||
modelValue: {
|
||||
id: "5",
|
||||
preferredUsername: "hello",
|
||||
name: "Sigmund",
|
||||
},
|
||||
},
|
||||
global: {
|
||||
...global_data,
|
||||
@@ -52,22 +61,13 @@ const generateWrapper = () => {
|
||||
});
|
||||
};
|
||||
|
||||
describe("GroupMembers", () => {
|
||||
describe("OrganizerPickerWrapper", () => {
|
||||
it("Show simple", async () => {
|
||||
const wrapper = generateWrapper();
|
||||
await wrapper.vm.$nextTick();
|
||||
await flushPromises();
|
||||
expect(htmlRemoveId(wrapper.html())).toMatchSnapshot();
|
||||
expect(requestHandlers.handle_0).toHaveBeenCalledTimes(0);
|
||||
expect(requestHandlers.handle_1).toHaveBeenCalledTimes(1);
|
||||
expect(requestHandlers.handle_2).toHaveBeenCalledTimes(0);
|
||||
expect(requestHandlers.handle_3).toHaveBeenCalledTimes(0);
|
||||
expect(requestHandlers.handle_4).toHaveBeenCalledTimes(0);
|
||||
expect(requestHandlers.handle_1).toHaveBeenCalledWith({
|
||||
groupName: "my-group",
|
||||
limit: 10,
|
||||
page: 1,
|
||||
roles: undefined,
|
||||
});
|
||||
expect(requestHandlers.handle_1).toHaveBeenCalledTimes(0);
|
||||
});
|
||||
});
|
||||
160
tests/unit/specs/components/Event/ParticipationButton.spec.ts
Normal file
160
tests/unit/specs/components/Event/ParticipationButton.spec.ts
Normal file
@@ -0,0 +1,160 @@
|
||||
import { beforeEach, describe, it, expect } from "vitest";
|
||||
import { enUS } from "date-fns/locale";
|
||||
import { routes } from "@/router";
|
||||
import { createRouter, createWebHistory, Router } from "vue-router";
|
||||
import { config, mount } from "@vue/test-utils";
|
||||
import { Oruga } from "@oruga-ui/oruga-next";
|
||||
import flushPromises from "flush-promises";
|
||||
import { getMockClient } from "../../mocks/client";
|
||||
import { htmlRemoveId } from "../../common";
|
||||
import ParticipationButton from "@/components/Event/ParticipationButton.vue";
|
||||
import { IPerson } from "@/types/actor";
|
||||
import { EventJoinOptions, ParticipantRole } from "@/types/enums";
|
||||
import { IEvent } from "@/types/event.model";
|
||||
import { IParticipant } from "@/types/participant.model";
|
||||
|
||||
config.global.plugins.push(Oruga);
|
||||
|
||||
let router: Router;
|
||||
|
||||
beforeEach(async () => {
|
||||
router = createRouter({
|
||||
history: createWebHistory(),
|
||||
routes: routes,
|
||||
});
|
||||
|
||||
// await router.isReady();
|
||||
});
|
||||
|
||||
const generateWrapper = (props) => {
|
||||
const global_data = getMockClient([]);
|
||||
global_data.provide.dateFnsLocale = enUS;
|
||||
global_data.plugins = [router];
|
||||
return mount(ParticipationButton, {
|
||||
props: props,
|
||||
global: {
|
||||
...global_data,
|
||||
stubs: {
|
||||
RouterLink: false,
|
||||
},
|
||||
},
|
||||
});
|
||||
};
|
||||
|
||||
const emptyCurrentActor: IPerson = {};
|
||||
|
||||
const currentActor: IPerson = {
|
||||
id: "1",
|
||||
preferredUsername: "tcit",
|
||||
name: "Thomas",
|
||||
avatar: {
|
||||
url: "https://mobilizon.fr/media/3a5f18c058a8193b1febfaf561f94ae8b91f85ac64c01ddf5ad7b251fb43baf5.jpg?name=profil.jpg",
|
||||
},
|
||||
};
|
||||
|
||||
const participation: IParticipant = {
|
||||
actor: currentActor,
|
||||
role: ParticipantRole.PARTICIPANT,
|
||||
};
|
||||
|
||||
const identities: IPerson[] = [
|
||||
currentActor,
|
||||
{
|
||||
id: "2",
|
||||
preferredUsername: "another",
|
||||
name: "Another",
|
||||
avatar: {
|
||||
url: "https://mobilizon.fr/media/95ab5ba92287ab4857bb517cadae2a7ab6a553748d1c48cefc27e2b7ab640fea.jpg?name=FB_IMG_16150214351371162.jpg",
|
||||
},
|
||||
},
|
||||
];
|
||||
|
||||
const event: IEvent = {
|
||||
uuid: "0123456789",
|
||||
title: "hello",
|
||||
url: "https://mobilizon.fr/events/an-uuid",
|
||||
options: {
|
||||
anonymousParticipation: false,
|
||||
},
|
||||
joinOptions: EventJoinOptions.FREE,
|
||||
};
|
||||
|
||||
describe("ParticipationButton", () => {
|
||||
it("Show Unlogged", async () => {
|
||||
const wrapper = generateWrapper({
|
||||
event: event,
|
||||
currentActor: emptyCurrentActor,
|
||||
participation: undefined,
|
||||
identities: [],
|
||||
});
|
||||
await wrapper.vm.$nextTick();
|
||||
await flushPromises();
|
||||
expect(htmlRemoveId(wrapper.html())).toMatchSnapshot();
|
||||
});
|
||||
|
||||
it("Show Basic", async () => {
|
||||
const wrapper = generateWrapper({
|
||||
event: event,
|
||||
currentActor: currentActor,
|
||||
participation: undefined,
|
||||
identities: identities,
|
||||
});
|
||||
await wrapper.vm.$nextTick();
|
||||
await flushPromises();
|
||||
expect(htmlRemoveId(wrapper.html())).toMatchSnapshot();
|
||||
});
|
||||
|
||||
it("Show Basic with confirmation", async () => {
|
||||
const wrapper = generateWrapper({
|
||||
event: { ...event, joinOptions: EventJoinOptions.RESTRICTED },
|
||||
currentActor: currentActor,
|
||||
participation: undefined,
|
||||
identities: identities,
|
||||
});
|
||||
await wrapper.vm.$nextTick();
|
||||
await flushPromises();
|
||||
expect(htmlRemoveId(wrapper.html())).toMatchSnapshot();
|
||||
});
|
||||
|
||||
it("Show Participating", async () => {
|
||||
const wrapper = generateWrapper({
|
||||
event: event,
|
||||
currentActor: currentActor,
|
||||
participation: participation,
|
||||
identities: identities,
|
||||
});
|
||||
await wrapper.vm.$nextTick();
|
||||
await flushPromises();
|
||||
expect(htmlRemoveId(wrapper.html())).toMatchSnapshot();
|
||||
});
|
||||
|
||||
it("Show Pending approval", async () => {
|
||||
const wrapper = generateWrapper({
|
||||
event: event,
|
||||
currentActor: currentActor,
|
||||
participation: {
|
||||
...participation,
|
||||
role: ParticipantRole.NOT_APPROVED,
|
||||
},
|
||||
identities: identities,
|
||||
});
|
||||
await wrapper.vm.$nextTick();
|
||||
await flushPromises();
|
||||
expect(htmlRemoveId(wrapper.html())).toMatchSnapshot();
|
||||
});
|
||||
|
||||
it("Show Rejected", async () => {
|
||||
const wrapper = generateWrapper({
|
||||
event: event,
|
||||
currentActor: currentActor,
|
||||
participation: {
|
||||
...participation,
|
||||
role: ParticipantRole.REJECTED,
|
||||
},
|
||||
identities: identities,
|
||||
});
|
||||
await wrapper.vm.$nextTick();
|
||||
await flushPromises();
|
||||
expect(htmlRemoveId(wrapper.html())).toMatchSnapshot();
|
||||
});
|
||||
});
|
||||
92
tests/unit/specs/components/Event/ShareEventModal.spec.ts
Normal file
92
tests/unit/specs/components/Event/ShareEventModal.spec.ts
Normal file
@@ -0,0 +1,92 @@
|
||||
import { beforeEach, describe, it, expect } from "vitest";
|
||||
import { enUS } from "date-fns/locale";
|
||||
import { routes } from "@/router";
|
||||
import { createRouter, createWebHistory, Router } from "vue-router";
|
||||
import { config, mount } from "@vue/test-utils";
|
||||
import { Oruga } from "@oruga-ui/oruga-next";
|
||||
import flushPromises from "flush-promises";
|
||||
import { getMockClient, requestHandlers } from "../../mocks/client";
|
||||
import { htmlRemoveId } from "../../common";
|
||||
import ShareEventModal from "@/components/Event/ShareEventModal.vue";
|
||||
import { EventVisibility, EventStatus } from "@/types/enums";
|
||||
|
||||
config.global.plugins.push(Oruga);
|
||||
|
||||
let router: Router;
|
||||
|
||||
beforeEach(async () => {
|
||||
router = createRouter({
|
||||
history: createWebHistory(),
|
||||
routes: routes,
|
||||
});
|
||||
|
||||
// await router.isReady();
|
||||
});
|
||||
|
||||
const generateWrapper = (event: any, eventCapacityOK: boolean = true) => {
|
||||
const global_data = getMockClient([]);
|
||||
global_data.provide.dateFnsLocale = enUS;
|
||||
global_data.plugins = [router];
|
||||
return mount(ShareEventModal, {
|
||||
props: {
|
||||
event: event,
|
||||
eventCapacityOK: eventCapacityOK,
|
||||
},
|
||||
global: {
|
||||
...global_data,
|
||||
stubs: {
|
||||
RouterLink: false,
|
||||
},
|
||||
},
|
||||
});
|
||||
};
|
||||
|
||||
describe("ShareEventModal", () => {
|
||||
it("Show Public", async () => {
|
||||
const wrapper = generateWrapper({
|
||||
title: "hello",
|
||||
url: "https://mobilizon.fr/events/an-uuid",
|
||||
visibility: EventVisibility.PUBLIC,
|
||||
});
|
||||
await wrapper.vm.$nextTick();
|
||||
await flushPromises();
|
||||
expect(htmlRemoveId(wrapper.html())).toMatchSnapshot();
|
||||
});
|
||||
|
||||
it("Show Private", async () => {
|
||||
const wrapper = generateWrapper({
|
||||
title: "hello",
|
||||
url: "https://mobilizon.fr/events/an-uuid",
|
||||
visibility: EventVisibility.PRIVATE,
|
||||
});
|
||||
await wrapper.vm.$nextTick();
|
||||
await flushPromises();
|
||||
expect(htmlRemoveId(wrapper.html())).toMatchSnapshot();
|
||||
});
|
||||
|
||||
it("Show Cancelled", async () => {
|
||||
const wrapper = generateWrapper({
|
||||
title: "hello",
|
||||
url: "https://mobilizon.fr/events/an-uuid",
|
||||
visibility: EventVisibility.PUBLIC,
|
||||
status: EventStatus.CANCELLED,
|
||||
});
|
||||
await wrapper.vm.$nextTick();
|
||||
await flushPromises();
|
||||
expect(htmlRemoveId(wrapper.html())).toMatchSnapshot();
|
||||
});
|
||||
|
||||
it("Show No seats left", async () => {
|
||||
const wrapper = generateWrapper(
|
||||
{
|
||||
title: "hello",
|
||||
url: "https://mobilizon.fr/events/an-uuid",
|
||||
visibility: EventVisibility.PUBLIC,
|
||||
},
|
||||
false
|
||||
);
|
||||
await wrapper.vm.$nextTick();
|
||||
await flushPromises();
|
||||
expect(htmlRemoveId(wrapper.html())).toMatchSnapshot();
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,65 @@
|
||||
import { beforeEach, describe, it, expect } from "vitest";
|
||||
import { enUS } from "date-fns/locale";
|
||||
import { routes } from "@/router";
|
||||
import { createRouter, createWebHistory, Router } from "vue-router";
|
||||
import { config, mount } from "@vue/test-utils";
|
||||
import { Oruga } from "@oruga-ui/oruga-next";
|
||||
import flushPromises from "flush-promises";
|
||||
import { getMockClient } from "../../mocks/client";
|
||||
import { htmlRemoveId } from "../../common";
|
||||
import SkeletonEventResult from "@/components/Event/SkeletonEventResult.vue";
|
||||
|
||||
config.global.plugins.push(Oruga);
|
||||
|
||||
let router: Router;
|
||||
|
||||
beforeEach(async () => {
|
||||
router = createRouter({
|
||||
history: createWebHistory(),
|
||||
routes: routes,
|
||||
});
|
||||
|
||||
// await router.isReady();
|
||||
});
|
||||
|
||||
const generateWrapper = (props: any = {}) => {
|
||||
const global_data = getMockClient([]);
|
||||
global_data.provide.dateFnsLocale = enUS;
|
||||
global_data.plugins = [router];
|
||||
return mount(SkeletonEventResult, {
|
||||
props: props,
|
||||
global: {
|
||||
...global_data,
|
||||
stubs: {
|
||||
RouterLink: false,
|
||||
},
|
||||
},
|
||||
});
|
||||
};
|
||||
|
||||
describe("SkeletonEventResult", () => {
|
||||
it("Show row", async () => {
|
||||
const wrapper = generateWrapper();
|
||||
await wrapper.vm.$nextTick();
|
||||
await flushPromises();
|
||||
expect(htmlRemoveId(wrapper.html())).toMatchSnapshot();
|
||||
});
|
||||
|
||||
it("Show column", async () => {
|
||||
const wrapper = generateWrapper({
|
||||
viewMode: "column",
|
||||
});
|
||||
await wrapper.vm.$nextTick();
|
||||
await flushPromises();
|
||||
expect(htmlRemoveId(wrapper.html())).toMatchSnapshot();
|
||||
});
|
||||
|
||||
it("Show not minimal", async () => {
|
||||
const wrapper = generateWrapper({
|
||||
minimal: false,
|
||||
});
|
||||
await wrapper.vm.$nextTick();
|
||||
await flushPromises();
|
||||
expect(htmlRemoveId(wrapper.html())).toMatchSnapshot();
|
||||
});
|
||||
});
|
||||
@@ -2,13 +2,15 @@ import { beforeEach, describe, it, expect } from "vitest";
|
||||
import { enUS } from "date-fns/locale";
|
||||
import { routes } from "@/router";
|
||||
import { createRouter, createWebHistory, Router } from "vue-router";
|
||||
import { getMockClient, requestHandlers } from "../../mocks/client";
|
||||
import SendPasswordReset from "@/views/User/SendPasswordReset.vue";
|
||||
import { config, mount } from "@vue/test-utils";
|
||||
import { Oruga } from "@oruga-ui/oruga-next";
|
||||
import flushPromises from "flush-promises";
|
||||
import { SEND_RESET_PASSWORD } from "@/graphql/auth";
|
||||
import { getMockClient, requestHandlers } from "../../mocks/client";
|
||||
import { htmlRemoveId } from "../../common";
|
||||
import TagInput from "@/components/Event/TagInput.vue";
|
||||
import { FILTER_TAGS } from "@/graphql/tags";
|
||||
import { ITag } from "@/types/tag.model";
|
||||
import { reactive } from "vue";
|
||||
|
||||
config.global.plugins.push(Oruga);
|
||||
|
||||
@@ -23,13 +25,15 @@ beforeEach(async () => {
|
||||
// await router.isReady();
|
||||
});
|
||||
|
||||
const tags = reactive<ITag[]>([{ title: "Hello", slug: "hello" }]);
|
||||
|
||||
const generateWrapper = () => {
|
||||
const global_data = getMockClient([SEND_RESET_PASSWORD]);
|
||||
const global_data = getMockClient([FILTER_TAGS]);
|
||||
global_data.provide.dateFnsLocale = enUS;
|
||||
global_data.plugins = [router];
|
||||
return mount(SendPasswordReset, {
|
||||
return mount(TagInput, {
|
||||
props: {
|
||||
email: "some@email.tld",
|
||||
modelValue: tags,
|
||||
},
|
||||
global: {
|
||||
...global_data,
|
||||
@@ -40,20 +44,12 @@ const generateWrapper = () => {
|
||||
});
|
||||
};
|
||||
|
||||
describe("SendPasswordReset", () => {
|
||||
it("Show simple", async () => {
|
||||
describe("TagInput", () => {
|
||||
it("Show new", async () => {
|
||||
const wrapper = generateWrapper();
|
||||
await wrapper.vm.$nextTick();
|
||||
await flushPromises();
|
||||
expect(htmlRemoveId(wrapper.html())).toMatchSnapshot();
|
||||
expect(requestHandlers.handle_0).toHaveBeenCalledTimes(0);
|
||||
|
||||
wrapper.find("form").trigger("submit");
|
||||
await flushPromises();
|
||||
expect(htmlRemoveId(wrapper.html())).toMatchSnapshot();
|
||||
|
||||
expect(requestHandlers.handle_0).toHaveBeenCalledWith({
|
||||
email: "some@email.tld",
|
||||
});
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,17 @@
|
||||
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
|
||||
|
||||
exports[`DateCalendarIcon > Show new 1`] = `
|
||||
"<div data-v-1df97f42="" class="datetime-container flex flex-col rounded-lg text-center justify-center overflow-hidden items-stretch bg-white dark:bg-gray-700 text-black dark:text-white" style="--small: 2;">
|
||||
<div data-v-1df97f42="" class="datetime-container-header bg-red-400 dark:bg-red-900"><time data-v-1df97f42="" datetime="2022-02-02T02:04:00.000Z" class="weekday">Wed</time></div>
|
||||
<div data-v-1df97f42="" class="datetime-container-content"><time data-v-1df97f42="" datetime="2022-02-02T02:04:00.000Z" class="day block font-semibold">2</time><time data-v-1df97f42="" datetime="2022-02-02T02:04:00.000Z" class="month font-semibold block uppercase py-1 px-0">Feb</time></div>
|
||||
<div data-v-1df97f42="" class="datetime-container-footer bg-red-400 dark:bg-red-900"><time data-v-1df97f42="" datetime="2022-02-02T02:04:00.000Z" class="year">2022</time></div>
|
||||
</div>"
|
||||
`;
|
||||
|
||||
exports[`DateCalendarIcon > Show small 1`] = `
|
||||
"<div data-v-1df97f42="" class="datetime-container flex flex-col rounded-lg text-center justify-center overflow-hidden items-stretch bg-white dark:bg-gray-700 text-black dark:text-white small" style="--small: 1.2;">
|
||||
<div data-v-1df97f42="" class="datetime-container-header bg-red-400 dark:bg-red-900"><time data-v-1df97f42="" datetime="2022-02-02T02:04:00.000Z" class="weekday">Wed</time></div>
|
||||
<div data-v-1df97f42="" class="datetime-container-content"><time data-v-1df97f42="" datetime="2022-02-02T02:04:00.000Z" class="day block font-semibold">2</time><time data-v-1df97f42="" datetime="2022-02-02T02:04:00.000Z" class="month font-semibold block uppercase py-1 px-0">Feb</time></div>
|
||||
<div data-v-1df97f42="" class="datetime-container-footer bg-red-400 dark:bg-red-900"><time data-v-1df97f42="" datetime="2022-02-02T02:04:00.000Z" class="year">2022</time></div>
|
||||
</div>"
|
||||
`;
|
||||
@@ -0,0 +1,252 @@
|
||||
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
|
||||
|
||||
exports[`EventCard > Show Row mode 1`] = `
|
||||
"<a data-v-4bd07c72="" href="/events/0123456789" class="mbz-card snap-center dark:bg-mbz-purple sm:flex sm:items-start">
|
||||
<div data-v-4bd07c72="" class="rounded-lg sm:w-full sm:max-w-[20rem]">
|
||||
<div data-v-4bd07c72="" class="-mt-3 h-0 mb-3 ltr:ml-0 rtl:mr-0 block relative z-10 sm:hidden calendar-simple">
|
||||
<div data-v-1df97f42="" data-v-4bd07c72="" class="datetime-container flex flex-col rounded-lg text-center justify-center overflow-hidden items-stretch bg-white dark:bg-gray-700 text-black dark:text-white small" style="--small: 1.2;">
|
||||
<div data-v-1df97f42="" class="datetime-container-header bg-red-400 dark:bg-red-900"><time data-v-1df97f42="" datetime="2022-02-02T02:04:00.000Z" class="weekday">Wed</time></div>
|
||||
<div data-v-1df97f42="" class="datetime-container-content"><time data-v-1df97f42="" datetime="2022-02-02T02:04:00.000Z" class="day block font-semibold">2</time><time data-v-1df97f42="" datetime="2022-02-02T02:04:00.000Z" class="month font-semibold block uppercase py-1 px-0">Feb</time></div>
|
||||
<div data-v-1df97f42="" class="datetime-container-footer bg-red-400 dark:bg-red-900"><time data-v-1df97f42="" datetime="2022-02-02T02:04:00.000Z" class="year">2022</time></div>
|
||||
</div>
|
||||
<!--v-if-->
|
||||
<!--v-if-->
|
||||
</div>
|
||||
<figure data-v-4bd07c72="" class="block relative pt-40">
|
||||
<div data-v-4bd07c72="" class="flex-1" style="height: 100%; position: absolute; top: 0px; left: 0px; width: 100%;">
|
||||
<div class="h-full w-full max-w-100 min-h-[10rem]">
|
||||
<!-- Show the placeholder as background -->
|
||||
<!--v-if-->
|
||||
<!-- Show the real image on the top and fade in after loading --><img class="transition-opacity duration-500 rounded-lg object-cover mx-auto h-full opacity-0" alt="" src="https://mobilizon.fr/media/81d9c76aaf740f84eefb28cf2b9988bdd2495ab1f3246159fd688e242155cb23.png?name=Screenshot_20220315_171848.png" loading="lazy">
|
||||
</div>
|
||||
</div>
|
||||
<div data-v-4bd07c72="" class="absolute top-3 right-0 ltr:-mr-1 rtl:-ml-1 z-10 max-w-xs no-underline flex flex-col gap-1 items-end" style="display: none;">
|
||||
<!--v-if-->
|
||||
<!--v-if--><a data-v-4bd07c72="" href="/tag/Something" class=""><span data-v-6955ca87="" data-v-4bd07c72="" class="rounded-md truncate text-sm text-black px-2 py-1 bg-purple-3 dark:text-violet-3 before:content-['#']" dir="auto">Something</span></a>
|
||||
</div>
|
||||
</figure>
|
||||
</div>
|
||||
<div data-v-4bd07c72="" class="p-2 flex-auto sm:flex-1">
|
||||
<div data-v-4bd07c72="" class="relative flex flex-col h-full">
|
||||
<div data-v-4bd07c72="" class="-mt-3 h-0 flex mb-3 ltr:ml-0 rtl:mr-0 items-end self-end sm:hidden">
|
||||
<!--v-if-->
|
||||
</div><span data-v-4bd07c72="" class="text-gray-700 dark:text-white font-semibold hidden sm:block">Feb 2, 2022, 3:04 AM</span>
|
||||
<!--v-if-->
|
||||
<div data-v-4bd07c72="" class="w-full flex flex-col justify-between h-full">
|
||||
<h2 data-v-4bd07c72="" class="mt-0 mb-2 text-2xl line-clamp-3 font-bold text-violet-3 dark:text-white" dir="auto" lang="en">A very long title that will have trouble to display because it will take multiple lines but where will it stop ?! Maybe after 3 lines is enough. Let's say so. But if it doesn't work, we really need to truncate it at some point. Definitively.</h2>
|
||||
<div data-v-4bd07c72="" class="">
|
||||
<div data-v-4bd07c72="" class="flex items-center text-violet-3 dark:text-white" dir="auto">
|
||||
<figure data-v-4bd07c72="" class=""><img data-v-4bd07c72="" class="rounded-xl" src="https://mobilizon.fr/media/653c2dcbb830636e0db975798163b85e038dfb7713e866e96d36bd411e105e3c.png?name=festivalsanantes%27s%20avatar.png" alt="" width="24" height="24" loading="lazy"></figure><span data-v-4bd07c72="" class="font-semibold ltr:pl-2 rtl:pr-2">Hello</span>
|
||||
</div>
|
||||
<div data-v-4bd07c72="" class="truncate flex gap-1" dir="auto" title="Somewhere, "><span aria-hidden="true" class="material-design-icon map-marker-icon" role="img"><svg fill="currentColor" class="material-design-icon__svg" width="24" height="24" viewBox="0 0 24 24"><path d="M12,11.5A2.5,2.5 0 0,1 9.5,9A2.5,2.5 0 0,1 12,6.5A2.5,2.5 0 0,1 14.5,9A2.5,2.5 0 0,1 12,11.5M12,2A7,7 0 0,0 5,9C5,14.25 12,22 12,22C12,22 19,14.25 19,9A7,7 0 0,0 12,2Z"><!--v-if--></path></svg></span><span>Somewhere</span></div>
|
||||
<div data-v-4bd07c72="" class="mt-1 no-underline gap-1 items-center hidden sm:flex">
|
||||
<!--v-if-->
|
||||
<!--v-if-->
|
||||
<!--v-if--><a data-v-4bd07c72="" href="/tag/Something" class=""><span data-v-6955ca87="" data-v-4bd07c72="" class="rounded-md truncate text-sm text-black px-2 py-1 bg-purple-3 dark:text-violet-3 before:content-['#']" dir="auto">Something</span></a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</a>"
|
||||
`;
|
||||
|
||||
exports[`EventCard > Show cancelled 1`] = `
|
||||
"<a data-v-4bd07c72="" href="/events/0123456789" class="mbz-card snap-center dark:bg-mbz-purple sm:max-w-xs w-[18rem] shrink-0 flex flex-col">
|
||||
<div data-v-4bd07c72="" class="rounded-lg">
|
||||
<div data-v-4bd07c72="" class="-mt-3 h-0 mb-3 ltr:ml-0 rtl:mr-0 block relative z-10 calendar-simple">
|
||||
<div data-v-1df97f42="" data-v-4bd07c72="" class="datetime-container flex flex-col rounded-lg text-center justify-center overflow-hidden items-stretch bg-white dark:bg-gray-700 text-black dark:text-white small" style="--small: 1.2;">
|
||||
<div data-v-1df97f42="" class="datetime-container-header bg-red-400 dark:bg-red-900"><time data-v-1df97f42="" datetime="2022-02-02T02:04:00.000Z" class="weekday">Wed</time></div>
|
||||
<div data-v-1df97f42="" class="datetime-container-content"><time data-v-1df97f42="" datetime="2022-02-02T02:04:00.000Z" class="day block font-semibold">2</time><time data-v-1df97f42="" datetime="2022-02-02T02:04:00.000Z" class="month font-semibold block uppercase py-1 px-0">Feb</time></div>
|
||||
<div data-v-1df97f42="" class="datetime-container-footer bg-red-400 dark:bg-red-900"><time data-v-1df97f42="" datetime="2022-02-02T02:04:00.000Z" class="year">2022</time></div>
|
||||
</div>
|
||||
<!--v-if-->
|
||||
<!--v-if-->
|
||||
</div>
|
||||
<figure data-v-4bd07c72="" class="block relative pt-40">
|
||||
<div data-v-4bd07c72="" class="flex-1" style="height: 100%; position: absolute; top: 0px; left: 0px; width: 100%;">
|
||||
<div class="h-full w-full max-w-100 min-h-[10rem]">
|
||||
<!-- Show the placeholder as background -->
|
||||
<!--v-if-->
|
||||
<!-- Show the real image on the top and fade in after loading --><img class="transition-opacity duration-500 rounded-lg object-cover mx-auto h-full opacity-0" alt="" src="https://mobilizon.fr/media/81d9c76aaf740f84eefb28cf2b9988bdd2495ab1f3246159fd688e242155cb23.png?name=Screenshot_20220315_171848.png" loading="lazy">
|
||||
</div>
|
||||
</div>
|
||||
<div data-v-4bd07c72="" class="absolute top-3 right-0 ltr:-mr-1 rtl:-ml-1 z-10 max-w-xs no-underline flex flex-col gap-1 items-end">
|
||||
<!--v-if--><span data-v-6955ca87="" data-v-4bd07c72="" class="rounded-md truncate text-sm text-black px-2 py-1 bg-mbz-danger dark:text-white">Cancelled</span><a data-v-4bd07c72="" href="/tag/Something" class=""><span data-v-6955ca87="" data-v-4bd07c72="" class="rounded-md truncate text-sm text-black px-2 py-1 bg-purple-3 dark:text-violet-3 before:content-['#']" dir="auto">Something</span></a>
|
||||
</div>
|
||||
</figure>
|
||||
</div>
|
||||
<div data-v-4bd07c72="" class="p-2 flex-auto">
|
||||
<div data-v-4bd07c72="" class="relative flex flex-col h-full">
|
||||
<div data-v-4bd07c72="" class="-mt-3 h-0 flex mb-3 ltr:ml-0 rtl:mr-0 items-end self-end">
|
||||
<!--v-if-->
|
||||
</div><span data-v-4bd07c72="" class="text-gray-700 dark:text-white font-semibold hidden">Feb 2, 2022, 3:04 AM</span>
|
||||
<!--v-if-->
|
||||
<div data-v-4bd07c72="" class="w-full flex flex-col justify-between h-full">
|
||||
<h2 data-v-4bd07c72="" class="mt-0 mb-2 text-2xl line-clamp-3 font-bold text-violet-3 dark:text-white" dir="auto" lang="en">A very interesting event</h2>
|
||||
<div data-v-4bd07c72="" class="">
|
||||
<div data-v-4bd07c72="" class="flex items-center text-violet-3 dark:text-white" dir="auto">
|
||||
<figure data-v-4bd07c72="" class=""><img data-v-4bd07c72="" class="rounded-xl" src="https://mobilizon.fr/media/653c2dcbb830636e0db975798163b85e038dfb7713e866e96d36bd411e105e3c.png?name=festivalsanantes%27s%20avatar.png" alt="" width="24" height="24" loading="lazy"></figure><span data-v-4bd07c72="" class="font-semibold ltr:pl-2 rtl:pr-2">Hello</span>
|
||||
</div>
|
||||
<div data-v-4bd07c72="" class="truncate flex gap-1" dir="auto" title="Somewhere, "><span aria-hidden="true" class="material-design-icon map-marker-icon" role="img"><svg fill="currentColor" class="material-design-icon__svg" width="24" height="24" viewBox="0 0 24 24"><path d="M12,11.5A2.5,2.5 0 0,1 9.5,9A2.5,2.5 0 0,1 12,6.5A2.5,2.5 0 0,1 14.5,9A2.5,2.5 0 0,1 12,11.5M12,2A7,7 0 0,0 5,9C5,14.25 12,22 12,22C12,22 19,14.25 19,9A7,7 0 0,0 12,2Z"><!--v-if--></path></svg></span><span>Somewhere</span></div>
|
||||
<div data-v-4bd07c72="" class="mt-1 no-underline gap-1 items-center hidden">
|
||||
<!--v-if-->
|
||||
<!--v-if--><span data-v-6955ca87="" data-v-4bd07c72="" class="rounded-md truncate text-sm text-black px-2 py-1 bg-mbz-danger dark:text-white">Cancelled</span><a data-v-4bd07c72="" href="/tag/Something" class=""><span data-v-6955ca87="" data-v-4bd07c72="" class="rounded-md truncate text-sm text-black px-2 py-1 bg-purple-3 dark:text-violet-3 before:content-['#']" dir="auto">Something</span></a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</a>"
|
||||
`;
|
||||
|
||||
exports[`EventCard > Show default 1`] = `
|
||||
"<a data-v-4bd07c72="" href="/events/0123456789" class="mbz-card snap-center dark:bg-mbz-purple sm:max-w-xs w-[18rem] shrink-0 flex flex-col">
|
||||
<div data-v-4bd07c72="" class="rounded-lg">
|
||||
<div data-v-4bd07c72="" class="-mt-3 h-0 mb-3 ltr:ml-0 rtl:mr-0 block relative z-10 calendar-simple">
|
||||
<div data-v-1df97f42="" data-v-4bd07c72="" class="datetime-container flex flex-col rounded-lg text-center justify-center overflow-hidden items-stretch bg-white dark:bg-gray-700 text-black dark:text-white small" style="--small: 1.2;">
|
||||
<div data-v-1df97f42="" class="datetime-container-header bg-red-400 dark:bg-red-900"><time data-v-1df97f42="" datetime="2022-02-02T02:04:00.000Z" class="weekday">Wed</time></div>
|
||||
<div data-v-1df97f42="" class="datetime-container-content"><time data-v-1df97f42="" datetime="2022-02-02T02:04:00.000Z" class="day block font-semibold">2</time><time data-v-1df97f42="" datetime="2022-02-02T02:04:00.000Z" class="month font-semibold block uppercase py-1 px-0">Feb</time></div>
|
||||
<div data-v-1df97f42="" class="datetime-container-footer bg-red-400 dark:bg-red-900"><time data-v-1df97f42="" datetime="2022-02-02T02:04:00.000Z" class="year">2022</time></div>
|
||||
</div>
|
||||
<!--v-if-->
|
||||
<!--v-if-->
|
||||
</div>
|
||||
<figure data-v-4bd07c72="" class="block relative pt-40">
|
||||
<div data-v-4bd07c72="" class="flex-1" style="height: 100%; position: absolute; top: 0px; left: 0px; width: 100%;">
|
||||
<div class="h-full w-full max-w-100 min-h-[10rem]">
|
||||
<!-- Show the placeholder as background -->
|
||||
<!--v-if-->
|
||||
<!-- Show the real image on the top and fade in after loading --><img class="transition-opacity duration-500 rounded-lg object-cover mx-auto h-full opacity-0" alt="" src="https://mobilizon.fr/media/81d9c76aaf740f84eefb28cf2b9988bdd2495ab1f3246159fd688e242155cb23.png?name=Screenshot_20220315_171848.png" loading="lazy">
|
||||
</div>
|
||||
</div>
|
||||
<div data-v-4bd07c72="" class="absolute top-3 right-0 ltr:-mr-1 rtl:-ml-1 z-10 max-w-xs no-underline flex flex-col gap-1 items-end">
|
||||
<!--v-if-->
|
||||
<!--v-if--><a data-v-4bd07c72="" href="/tag/Something" class=""><span data-v-6955ca87="" data-v-4bd07c72="" class="rounded-md truncate text-sm text-black px-2 py-1 bg-purple-3 dark:text-violet-3 before:content-['#']" dir="auto">Something</span></a>
|
||||
</div>
|
||||
</figure>
|
||||
</div>
|
||||
<div data-v-4bd07c72="" class="p-2 flex-auto">
|
||||
<div data-v-4bd07c72="" class="relative flex flex-col h-full">
|
||||
<div data-v-4bd07c72="" class="-mt-3 h-0 flex mb-3 ltr:ml-0 rtl:mr-0 items-end self-end">
|
||||
<!--v-if-->
|
||||
</div><span data-v-4bd07c72="" class="text-gray-700 dark:text-white font-semibold hidden">Feb 2, 2022, 3:04 AM</span>
|
||||
<!--v-if-->
|
||||
<div data-v-4bd07c72="" class="w-full flex flex-col justify-between h-full">
|
||||
<h2 data-v-4bd07c72="" class="mt-0 mb-2 text-2xl line-clamp-3 font-bold text-violet-3 dark:text-white" dir="auto" lang="en">A very interesting event</h2>
|
||||
<div data-v-4bd07c72="" class="">
|
||||
<div data-v-4bd07c72="" class="flex items-center text-violet-3 dark:text-white" dir="auto">
|
||||
<figure data-v-4bd07c72="" class=""><img data-v-4bd07c72="" class="rounded-xl" src="https://mobilizon.fr/media/653c2dcbb830636e0db975798163b85e038dfb7713e866e96d36bd411e105e3c.png?name=festivalsanantes%27s%20avatar.png" alt="" width="24" height="24" loading="lazy"></figure><span data-v-4bd07c72="" class="font-semibold ltr:pl-2 rtl:pr-2">Hello</span>
|
||||
</div>
|
||||
<div data-v-4bd07c72="" class="truncate flex gap-1" dir="auto" title="Somewhere, "><span aria-hidden="true" class="material-design-icon map-marker-icon" role="img"><svg fill="currentColor" class="material-design-icon__svg" width="24" height="24" viewBox="0 0 24 24"><path d="M12,11.5A2.5,2.5 0 0,1 9.5,9A2.5,2.5 0 0,1 12,6.5A2.5,2.5 0 0,1 14.5,9A2.5,2.5 0 0,1 12,11.5M12,2A7,7 0 0,0 5,9C5,14.25 12,22 12,22C12,22 19,14.25 19,9A7,7 0 0,0 12,2Z"><!--v-if--></path></svg></span><span>Somewhere</span></div>
|
||||
<div data-v-4bd07c72="" class="mt-1 no-underline gap-1 items-center hidden">
|
||||
<!--v-if-->
|
||||
<!--v-if-->
|
||||
<!--v-if--><a data-v-4bd07c72="" href="/tag/Something" class=""><span data-v-6955ca87="" data-v-4bd07c72="" class="rounded-md truncate text-sm text-black px-2 py-1 bg-purple-3 dark:text-violet-3 before:content-['#']" dir="auto">Something</span></a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</a>"
|
||||
`;
|
||||
|
||||
exports[`EventCard > Show long 1`] = `
|
||||
"<a data-v-4bd07c72="" href="/events/0123456789" class="mbz-card snap-center dark:bg-mbz-purple sm:max-w-xs w-[18rem] shrink-0 flex flex-col">
|
||||
<div data-v-4bd07c72="" class="rounded-lg">
|
||||
<div data-v-4bd07c72="" class="-mt-3 h-0 mb-3 ltr:ml-0 rtl:mr-0 block relative z-10 calendar-simple">
|
||||
<div data-v-1df97f42="" data-v-4bd07c72="" class="datetime-container flex flex-col rounded-lg text-center justify-center overflow-hidden items-stretch bg-white dark:bg-gray-700 text-black dark:text-white small" style="--small: 1.2;">
|
||||
<div data-v-1df97f42="" class="datetime-container-header bg-red-400 dark:bg-red-900"><time data-v-1df97f42="" datetime="2022-02-02T02:04:00.000Z" class="weekday">Wed</time></div>
|
||||
<div data-v-1df97f42="" class="datetime-container-content"><time data-v-1df97f42="" datetime="2022-02-02T02:04:00.000Z" class="day block font-semibold">2</time><time data-v-1df97f42="" datetime="2022-02-02T02:04:00.000Z" class="month font-semibold block uppercase py-1 px-0">Feb</time></div>
|
||||
<div data-v-1df97f42="" class="datetime-container-footer bg-red-400 dark:bg-red-900"><time data-v-1df97f42="" datetime="2022-02-02T02:04:00.000Z" class="year">2022</time></div>
|
||||
</div>
|
||||
<!--v-if-->
|
||||
<!--v-if-->
|
||||
</div>
|
||||
<figure data-v-4bd07c72="" class="block relative pt-40">
|
||||
<div data-v-4bd07c72="" class="flex-1" style="height: 100%; position: absolute; top: 0px; left: 0px; width: 100%;">
|
||||
<div class="h-full w-full max-w-100 min-h-[10rem]">
|
||||
<!-- Show the placeholder as background -->
|
||||
<!--v-if-->
|
||||
<!-- Show the real image on the top and fade in after loading --><img class="transition-opacity duration-500 rounded-lg object-cover mx-auto h-full opacity-0" alt="" src="https://mobilizon.fr/media/81d9c76aaf740f84eefb28cf2b9988bdd2495ab1f3246159fd688e242155cb23.png?name=Screenshot_20220315_171848.png" loading="lazy">
|
||||
</div>
|
||||
</div>
|
||||
<div data-v-4bd07c72="" class="absolute top-3 right-0 ltr:-mr-1 rtl:-ml-1 z-10 max-w-xs no-underline flex flex-col gap-1 items-end">
|
||||
<!--v-if-->
|
||||
<!--v-if--><a data-v-4bd07c72="" href="/tag/Something" class=""><span data-v-6955ca87="" data-v-4bd07c72="" class="rounded-md truncate text-sm text-black px-2 py-1 bg-purple-3 dark:text-violet-3 before:content-['#']" dir="auto">Something</span></a>
|
||||
</div>
|
||||
</figure>
|
||||
</div>
|
||||
<div data-v-4bd07c72="" class="p-2 flex-auto">
|
||||
<div data-v-4bd07c72="" class="relative flex flex-col h-full">
|
||||
<div data-v-4bd07c72="" class="-mt-3 h-0 flex mb-3 ltr:ml-0 rtl:mr-0 items-end self-end">
|
||||
<!--v-if-->
|
||||
</div><span data-v-4bd07c72="" class="text-gray-700 dark:text-white font-semibold hidden">Feb 2, 2022, 3:04 AM</span>
|
||||
<!--v-if-->
|
||||
<div data-v-4bd07c72="" class="w-full flex flex-col justify-between h-full">
|
||||
<h2 data-v-4bd07c72="" class="mt-0 mb-2 text-2xl line-clamp-3 font-bold text-violet-3 dark:text-white" dir="auto" lang="en">A very long title that will have trouble to display because it will take multiple lines but where will it stop ?! Maybe after 3 lines is enough. Let's say so. But if it doesn't work, we really need to truncate it at some point. Definitively.</h2>
|
||||
<div data-v-4bd07c72="" class="">
|
||||
<div data-v-4bd07c72="" class="flex items-center text-violet-3 dark:text-white" dir="auto">
|
||||
<figure data-v-4bd07c72="" class=""><img data-v-4bd07c72="" class="rounded-xl" src="https://mobilizon.fr/media/653c2dcbb830636e0db975798163b85e038dfb7713e866e96d36bd411e105e3c.png?name=festivalsanantes%27s%20avatar.png" alt="" width="24" height="24" loading="lazy"></figure><span data-v-4bd07c72="" class="font-semibold ltr:pl-2 rtl:pr-2">Hello</span>
|
||||
</div>
|
||||
<div data-v-4bd07c72="" class="truncate flex gap-1" dir="auto" title="Somewhere, "><span aria-hidden="true" class="material-design-icon map-marker-icon" role="img"><svg fill="currentColor" class="material-design-icon__svg" width="24" height="24" viewBox="0 0 24 24"><path d="M12,11.5A2.5,2.5 0 0,1 9.5,9A2.5,2.5 0 0,1 12,6.5A2.5,2.5 0 0,1 14.5,9A2.5,2.5 0 0,1 12,11.5M12,2A7,7 0 0,0 5,9C5,14.25 12,22 12,22C12,22 19,14.25 19,9A7,7 0 0,0 12,2Z"><!--v-if--></path></svg></span><span>Somewhere</span></div>
|
||||
<div data-v-4bd07c72="" class="mt-1 no-underline gap-1 items-center hidden">
|
||||
<!--v-if-->
|
||||
<!--v-if-->
|
||||
<!--v-if--><a data-v-4bd07c72="" href="/tag/Something" class=""><span data-v-6955ca87="" data-v-4bd07c72="" class="rounded-md truncate text-sm text-black px-2 py-1 bg-purple-3 dark:text-violet-3 before:content-['#']" dir="auto">Something</span></a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</a>"
|
||||
`;
|
||||
|
||||
exports[`EventCard > Show tentative 1`] = `
|
||||
"<a data-v-4bd07c72="" href="/events/0123456789" class="mbz-card snap-center dark:bg-mbz-purple sm:max-w-xs w-[18rem] shrink-0 flex flex-col">
|
||||
<div data-v-4bd07c72="" class="rounded-lg">
|
||||
<div data-v-4bd07c72="" class="-mt-3 h-0 mb-3 ltr:ml-0 rtl:mr-0 block relative z-10 calendar-simple">
|
||||
<div data-v-1df97f42="" data-v-4bd07c72="" class="datetime-container flex flex-col rounded-lg text-center justify-center overflow-hidden items-stretch bg-white dark:bg-gray-700 text-black dark:text-white small" style="--small: 1.2;">
|
||||
<div data-v-1df97f42="" class="datetime-container-header bg-red-400 dark:bg-red-900"><time data-v-1df97f42="" datetime="2022-02-02T02:04:00.000Z" class="weekday">Wed</time></div>
|
||||
<div data-v-1df97f42="" class="datetime-container-content"><time data-v-1df97f42="" datetime="2022-02-02T02:04:00.000Z" class="day block font-semibold">2</time><time data-v-1df97f42="" datetime="2022-02-02T02:04:00.000Z" class="month font-semibold block uppercase py-1 px-0">Feb</time></div>
|
||||
<div data-v-1df97f42="" class="datetime-container-footer bg-red-400 dark:bg-red-900"><time data-v-1df97f42="" datetime="2022-02-02T02:04:00.000Z" class="year">2022</time></div>
|
||||
</div>
|
||||
<!--v-if-->
|
||||
<!--v-if-->
|
||||
</div>
|
||||
<figure data-v-4bd07c72="" class="block relative pt-40">
|
||||
<div data-v-4bd07c72="" class="flex-1" style="height: 100%; position: absolute; top: 0px; left: 0px; width: 100%;">
|
||||
<div class="h-full w-full max-w-100 min-h-[10rem]">
|
||||
<!-- Show the placeholder as background -->
|
||||
<!--v-if-->
|
||||
<!-- Show the real image on the top and fade in after loading --><img class="transition-opacity duration-500 rounded-lg object-cover mx-auto h-full opacity-0" alt="" src="https://mobilizon.fr/media/81d9c76aaf740f84eefb28cf2b9988bdd2495ab1f3246159fd688e242155cb23.png?name=Screenshot_20220315_171848.png" loading="lazy">
|
||||
</div>
|
||||
</div>
|
||||
<div data-v-4bd07c72="" class="absolute top-3 right-0 ltr:-mr-1 rtl:-ml-1 z-10 max-w-xs no-underline flex flex-col gap-1 items-end"><span data-v-6955ca87="" data-v-4bd07c72="" class="rounded-md truncate text-sm text-black px-2 py-1 bg-mbz-info dark:text-black">Tentative</span>
|
||||
<!--v-if--><a data-v-4bd07c72="" href="/tag/Something" class=""><span data-v-6955ca87="" data-v-4bd07c72="" class="rounded-md truncate text-sm text-black px-2 py-1 bg-purple-3 dark:text-violet-3 before:content-['#']" dir="auto">Something</span></a>
|
||||
</div>
|
||||
</figure>
|
||||
</div>
|
||||
<div data-v-4bd07c72="" class="p-2 flex-auto">
|
||||
<div data-v-4bd07c72="" class="relative flex flex-col h-full">
|
||||
<div data-v-4bd07c72="" class="-mt-3 h-0 flex mb-3 ltr:ml-0 rtl:mr-0 items-end self-end">
|
||||
<!--v-if-->
|
||||
</div><span data-v-4bd07c72="" class="text-gray-700 dark:text-white font-semibold hidden">Feb 2, 2022, 3:04 AM</span>
|
||||
<!--v-if-->
|
||||
<div data-v-4bd07c72="" class="w-full flex flex-col justify-between h-full">
|
||||
<h2 data-v-4bd07c72="" class="mt-0 mb-2 text-2xl line-clamp-3 font-bold text-violet-3 dark:text-white" dir="auto" lang="en">A very interesting event</h2>
|
||||
<div data-v-4bd07c72="" class="">
|
||||
<div data-v-4bd07c72="" class="flex items-center text-violet-3 dark:text-white" dir="auto">
|
||||
<figure data-v-4bd07c72="" class=""><img data-v-4bd07c72="" class="rounded-xl" src="https://mobilizon.fr/media/653c2dcbb830636e0db975798163b85e038dfb7713e866e96d36bd411e105e3c.png?name=festivalsanantes%27s%20avatar.png" alt="" width="24" height="24" loading="lazy"></figure><span data-v-4bd07c72="" class="font-semibold ltr:pl-2 rtl:pr-2">Hello</span>
|
||||
</div>
|
||||
<div data-v-4bd07c72="" class="truncate flex gap-1" dir="auto" title="Somewhere, "><span aria-hidden="true" class="material-design-icon map-marker-icon" role="img"><svg fill="currentColor" class="material-design-icon__svg" width="24" height="24" viewBox="0 0 24 24"><path d="M12,11.5A2.5,2.5 0 0,1 9.5,9A2.5,2.5 0 0,1 12,6.5A2.5,2.5 0 0,1 14.5,9A2.5,2.5 0 0,1 12,11.5M12,2A7,7 0 0,0 5,9C5,14.25 12,22 12,22C12,22 19,14.25 19,9A7,7 0 0,0 12,2Z"><!--v-if--></path></svg></span><span>Somewhere</span></div>
|
||||
<div data-v-4bd07c72="" class="mt-1 no-underline gap-1 items-center hidden">
|
||||
<!--v-if--><span data-v-6955ca87="" data-v-4bd07c72="" class="rounded-md truncate text-sm text-black px-2 py-1 bg-mbz-info dark:text-black">Tentative</span>
|
||||
<!--v-if--><a data-v-4bd07c72="" href="/tag/Something" class=""><span data-v-6955ca87="" data-v-4bd07c72="" class="rounded-md truncate text-sm text-black px-2 py-1 bg-purple-3 dark:text-violet-3 before:content-['#']" dir="auto">Something</span></a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</a>"
|
||||
`;
|
||||
@@ -0,0 +1,47 @@
|
||||
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
|
||||
|
||||
exports[`EventListViewCard > Show default 1`] = `
|
||||
"<article class="bg-white dark:bg-zinc-700 dark:text-white dark:hover:text-white rounded-lg shadow-md max-w-3xl p-2">
|
||||
<div class="flex gap-2">
|
||||
<div class="">
|
||||
<div data-v-1df97f42="" class="datetime-container flex flex-col rounded-lg text-center justify-center overflow-hidden items-stretch bg-white dark:bg-gray-700 text-black dark:text-white small" style="--small: 1.2;">
|
||||
<div data-v-1df97f42="" class="datetime-container-header bg-red-400 dark:bg-red-900"><time data-v-1df97f42="" datetime="2022-02-02T02:04:00.000Z" class="weekday">Wed</time></div>
|
||||
<div data-v-1df97f42="" class="datetime-container-content"><time data-v-1df97f42="" datetime="2022-02-02T02:04:00.000Z" class="day block font-semibold">2</time><time data-v-1df97f42="" datetime="2022-02-02T02:04:00.000Z" class="month font-semibold block uppercase py-1 px-0">Feb</time></div>
|
||||
<div data-v-1df97f42="" class="datetime-container-footer bg-red-400 dark:bg-red-900"><time data-v-1df97f42="" datetime="2022-02-02T02:04:00.000Z" class="year">2022</time></div>
|
||||
</div>
|
||||
</div><a href="/events/0123456789" class="">
|
||||
<h2 class="mt-0 line-clamp-2">A very interesting event</h2>
|
||||
</a>
|
||||
</div>
|
||||
<div class="">
|
||||
<!--v-if--><span>Published by Hello</span>
|
||||
</div>
|
||||
<div class="flex gap-1"><span><span aria-hidden="true" class="material-design-icon earth-icon" role="img"><svg fill="currentColor" class="material-design-icon__svg" width="24" height="24" viewBox="0 0 24 24"><path d="M17.9,17.39C17.64,16.59 16.89,16 16,16H15V13A1,1 0 0,0 14,12H8V10H10A1,1 0 0,0 11,9V7H13A2,2 0 0,0 15,5V4.59C17.93,5.77 20,8.64 20,12C20,14.08 19.2,15.97 17.9,17.39M11,19.93C7.05,19.44 4,16.08 4,12C4,11.38 4.08,10.78 4.21,10.21L9,15V16A2,2 0 0,0 11,18M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2Z"><!--v-if--></path></svg></span>
|
||||
<!--v-if-->
|
||||
<!--v-if--></span><span><span>0 participants</span></span>
|
||||
</div>
|
||||
</article>"
|
||||
`;
|
||||
|
||||
exports[`EventListViewCard > Show long 1`] = `
|
||||
"<article class="bg-white dark:bg-zinc-700 dark:text-white dark:hover:text-white rounded-lg shadow-md max-w-3xl p-2">
|
||||
<div class="flex gap-2">
|
||||
<div class="">
|
||||
<div data-v-1df97f42="" class="datetime-container flex flex-col rounded-lg text-center justify-center overflow-hidden items-stretch bg-white dark:bg-gray-700 text-black dark:text-white small" style="--small: 1.2;">
|
||||
<div data-v-1df97f42="" class="datetime-container-header bg-red-400 dark:bg-red-900"><time data-v-1df97f42="" datetime="2022-02-02T02:04:00.000Z" class="weekday">Wed</time></div>
|
||||
<div data-v-1df97f42="" class="datetime-container-content"><time data-v-1df97f42="" datetime="2022-02-02T02:04:00.000Z" class="day block font-semibold">2</time><time data-v-1df97f42="" datetime="2022-02-02T02:04:00.000Z" class="month font-semibold block uppercase py-1 px-0">Feb</time></div>
|
||||
<div data-v-1df97f42="" class="datetime-container-footer bg-red-400 dark:bg-red-900"><time data-v-1df97f42="" datetime="2022-02-02T02:04:00.000Z" class="year">2022</time></div>
|
||||
</div>
|
||||
</div><a href="/events/0123456789" class="">
|
||||
<h2 class="mt-0 line-clamp-2">A very long title that will have trouble to display because it will take multiple lines but where will it stop ?! Maybe after 3 lines is enough. Let's say so.</h2>
|
||||
</a>
|
||||
</div>
|
||||
<div class="">
|
||||
<!--v-if--><span>Published by Hello</span>
|
||||
</div>
|
||||
<div class="flex gap-1"><span><span aria-hidden="true" class="material-design-icon earth-icon" role="img"><svg fill="currentColor" class="material-design-icon__svg" width="24" height="24" viewBox="0 0 24 24"><path d="M17.9,17.39C17.64,16.59 16.89,16 16,16H15V13A1,1 0 0,0 14,12H8V10H10A1,1 0 0,0 11,9V7H13A2,2 0 0,0 15,5V4.59C17.93,5.77 20,8.64 20,12C20,14.08 19.2,15.97 17.9,17.39M11,19.93C7.05,19.44 4,16.08 4,12C4,11.38 4.08,10.78 4.21,10.21L9,15V16A2,2 0 0,0 11,18M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2Z"><!--v-if--></path></svg></span>
|
||||
<!--v-if-->
|
||||
<!--v-if--></span><span><span>0 participants</span></span>
|
||||
</div>
|
||||
</article>"
|
||||
`;
|
||||
@@ -0,0 +1,28 @@
|
||||
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
|
||||
|
||||
exports[`OrganizerPicker > Show simple 1`] = `
|
||||
"<div data-v-4ef6e9b3="" class="max-w-md mx-auto">
|
||||
<div data-v-4ef6e9b3="" data-oruga="input" class="o-input__wrapper o-input__wrapper--expanded"><input dir="auto" class="o-input" id="" data-oruga-input="text" type="text" autocomplete="off" placeholder="Filter by profile or group name">
|
||||
<!---->
|
||||
<!---->
|
||||
<!---->
|
||||
</div>
|
||||
<transition-group-stub data-v-4ef6e9b3="" tag="ul" enteractiveclass="duration-300 ease-out" enterfromclass="transform opacity-0" entertoclass="opacity-100" leaveactiveclass="duration-200 ease-in" leavefromclass="opacity-100" leavetoclass="transform opacity-0" appear="false" persisted="false" css="true" class="grid grid-cols-1 gap-y-3 m-5 max-w-md mx-auto">
|
||||
<li data-v-4ef6e9b3="" class="relative focus-within:shadow-lg"><input data-v-4ef6e9b3="" class="sr-only peer" type="radio" name="availableActors" id="availableActor-59" value="[object Object]"><label data-v-4ef6e9b3="" class="flex items-center gap-2 p-3 bg-white hover:bg-gray-50 dark:bg-violet-3 dark:hover:bg-violet-3/60 border border-gray-300 rounded-lg cursor-pointer peer-checked:ring-primary peer-checked:ring-2 peer-checked:border-transparent" for="availableActor-59"><span data-v-4ef6e9b3="" aria-hidden="true" class="material-design-icon account-circle-icon" role="img"><svg fill="currentColor" class="material-design-icon__svg" width="48" height="48" viewBox="0 0 24 24"><path d="M12,19.2C9.5,19.2 7.29,17.92 6,16C6.03,14 10,12.9 12,12.9C14,12.9 17.97,14 18,16C16.71,17.92 14.5,19.2 12,19.2M12,5A3,3 0 0,1 15,8A3,3 0 0,1 12,11A3,3 0 0,1 9,8A3,3 0 0,1 12,5M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12C22,6.47 17.5,2 12,2Z"><!--v-if--></path></svg></span>
|
||||
<div data-v-4ef6e9b3="" class="flex-1 w-px">
|
||||
<h3 data-v-4ef6e9b3="" class="line-clamp-2">Someone</h3><small data-v-4ef6e9b3="" class="flex truncate">@me</small>
|
||||
</div>
|
||||
</label></li>
|
||||
<li data-v-4ef6e9b3="" class="relative focus-within:shadow-lg"><input data-v-4ef6e9b3="" class="sr-only peer" type="radio" name="availableActors" id="availableActor-5" value="[object Object]"><label data-v-4ef6e9b3="" class="flex items-center gap-2 p-3 bg-white hover:bg-gray-50 dark:bg-violet-3 dark:hover:bg-violet-3/60 border border-gray-300 rounded-lg cursor-pointer peer-checked:ring-primary peer-checked:ring-2 peer-checked:border-transparent" for="availableActor-5"><span data-v-4ef6e9b3="" aria-hidden="true" class="material-design-icon account-circle-icon" role="img"><svg fill="currentColor" class="material-design-icon__svg" width="48" height="48" viewBox="0 0 24 24"><path d="M12,19.2C9.5,19.2 7.29,17.92 6,16C6.03,14 10,12.9 12,12.9C14,12.9 17.97,14 18,16C16.71,17.92 14.5,19.2 12,19.2M12,5A3,3 0 0,1 15,8A3,3 0 0,1 12,11A3,3 0 0,1 9,8A3,3 0 0,1 12,5M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12C22,6.47 17.5,2 12,2Z"><!--v-if--></path></svg></span>
|
||||
<div data-v-4ef6e9b3="" class="flex-1 w-px">
|
||||
<h3 data-v-4ef6e9b3="" class="line-clamp-2">Sigmund</h3><small data-v-4ef6e9b3="" class="flex truncate">@hello</small>
|
||||
</div>
|
||||
</label></li>
|
||||
<li data-v-4ef6e9b3="" class="relative focus-within:shadow-lg"><input data-v-4ef6e9b3="" class="sr-only peer" type="radio" name="availableActors" id="availableActor-89" value="[object Object]"><label data-v-4ef6e9b3="" class="flex items-center gap-2 p-3 bg-white hover:bg-gray-50 dark:bg-violet-3 dark:hover:bg-violet-3/60 border border-gray-300 rounded-lg cursor-pointer peer-checked:ring-primary peer-checked:ring-2 peer-checked:border-transparent" for="availableActor-89"><span data-v-4ef6e9b3="" aria-hidden="true" class="material-design-icon account-circle-icon" role="img"><svg fill="currentColor" class="material-design-icon__svg" width="48" height="48" viewBox="0 0 24 24"><path d="M12,19.2C9.5,19.2 7.29,17.92 6,16C6.03,14 10,12.9 12,12.9C14,12.9 17.97,14 18,16C16.71,17.92 14.5,19.2 12,19.2M12,5A3,3 0 0,1 15,8A3,3 0 0,1 12,11A3,3 0 0,1 9,8A3,3 0 0,1 12,5M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12C22,6.47 17.5,2 12,2Z"><!--v-if--></path></svg></span>
|
||||
<div data-v-4ef6e9b3="" class="flex-1 w-px">
|
||||
<h3 data-v-4ef6e9b3="" class="line-clamp-2">College</h3><small data-v-4ef6e9b3="" class="flex truncate">@congregation</small>
|
||||
</div>
|
||||
</label></li>
|
||||
</transition-group-stub>
|
||||
</div>"
|
||||
`;
|
||||
@@ -0,0 +1,47 @@
|
||||
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
|
||||
|
||||
exports[`OrganizerPickerWrapper > Show simple 1`] = `
|
||||
"<div class="bg-white dark:bg-violet-3 border border-gray-300 rounded-lg cursor-pointer">
|
||||
<!-- If we have a current actor (inline) -->
|
||||
<div class="" dir="auto">
|
||||
<div class="flex gap-1 p-4">
|
||||
<div class=""><span aria-hidden="true" class="material-design-icon account-circle-icon" role="img"><svg fill="currentColor" class="material-design-icon__svg" width="48" height="48" viewBox="0 0 24 24"><path d="M12,19.2C9.5,19.2 7.29,17.92 6,16C6.03,14 10,12.9 12,12.9C14,12.9 17.97,14 18,16C16.71,17.92 14.5,19.2 12,19.2M12,5A3,3 0 0,1 15,8A3,3 0 0,1 12,11A3,3 0 0,1 9,8A3,3 0 0,1 12,5M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12C22,6.47 17.5,2 12,2Z"><!--v-if--></path></svg></span></div>
|
||||
<div class="flex-1">
|
||||
<p class="">Sigmund</p>
|
||||
<p class="">@hello</p>
|
||||
</div><button type="button" class="o-btn" role="button" data-oruga="button"><span class="o-btn__wrapper"><!----><span class="o-btn__label">Change</span>
|
||||
<!----></span>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<!--teleport start-->
|
||||
<transition-stub name="zoom-out" appear="false" persisted="false" css="true">
|
||||
<div has-modal-card="" close-button-aria-label="Close" data-oruga="modal" class="o-modal" tabindex="-1" aria-modal="false" style="display: none;">
|
||||
<div class="o-modal__overlay" tabindex="-1" aria-hidden="true"></div>
|
||||
<div class="o-modal__content" style="max-width: 960px;">
|
||||
<div class="p-2 rounded">
|
||||
<header class="">
|
||||
<h2 class="">Pick a profile or a group</h2>
|
||||
</header>
|
||||
<section class="">
|
||||
<div class="flex flex-wrap gap-2 items-center flex-col lg:flex-row">
|
||||
<div class="max-h-[400px] overflow-y-auto flex-1 w-full">
|
||||
<!--v-if-->
|
||||
</div>
|
||||
<div class="pl-2 max-h-[400px] overflow-y-auto">
|
||||
<div class="">
|
||||
<p>Your profile will be shown as contact.</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
<footer class="my-2 text-center sm:text-right"><button type="button" class="o-btn o-btn--primary w-full sm:w-auto" role="button" data-oruga="button"><span class="o-btn__wrapper"><!----><span class="o-btn__label">Pick</span>
|
||||
<!----></span>
|
||||
</button></footer>
|
||||
</div><span class="o-icon o-icon--clickable o-icon--medium o-modal__close" data-oruga="icon" style="display: none;"><i class="mdi mdi-close mdi-36px"></i></span>
|
||||
</div>
|
||||
</div>
|
||||
</transition-stub>
|
||||
<!--teleport end-->
|
||||
</div>"
|
||||
`;
|
||||
@@ -0,0 +1,104 @@
|
||||
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
|
||||
|
||||
exports[`ParticipationButton > Show Basic 1`] = `
|
||||
"<div class="ml-auto w-min">
|
||||
<div data-oruga="dropdown" class="o-drop o-drop--position-bottom-left">
|
||||
<div tabindex="0" class="o-drop__trigger" aria-haspopup="true"><button type="button" class="o-btn o-btn--large o-btn--primary" role="button" data-oruga="button"><span class="o-btn__wrapper"><!----><span class="o-btn__label">Participate</span><span class="o-icon o-icon--large o-btn__icon o-btn__icon-right" data-oruga="icon"><i class="mdi mdi-menu-down mdi-48px"></i></span></span></button></div>
|
||||
<!--teleport start-->
|
||||
<transition-stub name="fade" appear="false" persisted="false" css="true">
|
||||
<!---->
|
||||
</transition-stub>
|
||||
<transition-stub name="fade" appear="false" persisted="false" css="true">
|
||||
<div class="o-drop__menu o-drop__menu--bottom-left" role="list" aria-hidden="true" aria-modal="true" style="display: none;">
|
||||
<div class="o-drop__item o-drop__item--clickable" role="listitem" tabindex="0" data-oruga="dropdown-item">
|
||||
<div class="flex gap-2 items-center">
|
||||
<figure class=""><img class="rounded-xl" src="https://mobilizon.fr/media/3a5f18c058a8193b1febfaf561f94ae8b91f85ac64c01ddf5ad7b251fb43baf5.jpg?name=profil.jpg" alt="" width="24" height="24"></figure>
|
||||
<div class=""><span>as Thomas</span></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="o-drop__item o-drop__item--clickable" role="listitem" tabindex="0" data-oruga="dropdown-item">with another identity…</div>
|
||||
</div>
|
||||
</transition-stub>
|
||||
<!--teleport end-->
|
||||
</div>
|
||||
</div>"
|
||||
`;
|
||||
|
||||
exports[`ParticipationButton > Show Basic with confirmation 1`] = `
|
||||
"<div class="ml-auto w-min">
|
||||
<div data-oruga="dropdown" class="o-drop o-drop--position-bottom-left">
|
||||
<div tabindex="0" class="o-drop__trigger" aria-haspopup="true"><button type="button" class="o-btn o-btn--large o-btn--primary" role="button" data-oruga="button"><span class="o-btn__wrapper"><!----><span class="o-btn__label">Participate</span><span class="o-icon o-icon--large o-btn__icon o-btn__icon-right" data-oruga="icon"><i class="mdi mdi-menu-down mdi-48px"></i></span></span></button></div>
|
||||
<!--teleport start-->
|
||||
<transition-stub name="fade" appear="false" persisted="false" css="true">
|
||||
<!---->
|
||||
</transition-stub>
|
||||
<transition-stub name="fade" appear="false" persisted="false" css="true">
|
||||
<div class="o-drop__menu o-drop__menu--bottom-left" role="list" aria-hidden="true" aria-modal="true" style="display: none;">
|
||||
<div class="o-drop__item o-drop__item--clickable" role="listitem" tabindex="0" data-oruga="dropdown-item">
|
||||
<div class="flex gap-2 items-center">
|
||||
<figure class=""><img class="rounded-xl" src="https://mobilizon.fr/media/3a5f18c058a8193b1febfaf561f94ae8b91f85ac64c01ddf5ad7b251fb43baf5.jpg?name=profil.jpg" alt="" width="24" height="24"></figure>
|
||||
<div class=""><span>as Thomas</span></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="o-drop__item o-drop__item--clickable" role="listitem" tabindex="0" data-oruga="dropdown-item">with another identity…</div>
|
||||
</div>
|
||||
</transition-stub>
|
||||
<!--teleport end-->
|
||||
</div>
|
||||
</div>"
|
||||
`;
|
||||
|
||||
exports[`ParticipationButton > Show Participating 1`] = `
|
||||
"<div class="ml-auto w-min">
|
||||
<div data-oruga="dropdown" class="o-drop o-drop--position-bottom-left">
|
||||
<div tabindex="0" class="o-drop__trigger" aria-haspopup="true"><button type="button" class="o-btn o-btn--large o-btn--success" role="button" data-oruga="button"><span class="o-btn__wrapper"><span class="o-icon o-icon--large o-btn__icon o-btn__icon-left" data-oruga="icon"><i class="mdi mdi-check mdi-48px"></i></span><span class="o-btn__label">I participate</span><span class="o-icon o-icon--large o-btn__icon o-btn__icon-right" data-oruga="icon"><i class="mdi mdi-menu-down mdi-48px"></i></span></span></button></div>
|
||||
<!--teleport start-->
|
||||
<transition-stub name="fade" appear="false" persisted="false" css="true">
|
||||
<!---->
|
||||
</transition-stub>
|
||||
<transition-stub name="fade" appear="false" persisted="false" css="true">
|
||||
<div class="o-drop__menu o-drop__menu--bottom-left" role="list" aria-hidden="true" aria-modal="true" style="display: none;">
|
||||
<div class="o-drop__item o-drop__item--clickable" role="listitem" tabindex="0" data-oruga="dropdown-item">Cancel my participation…</div>
|
||||
</div>
|
||||
</transition-stub>
|
||||
<!--teleport end-->
|
||||
</div>
|
||||
</div>"
|
||||
`;
|
||||
|
||||
exports[`ParticipationButton > Show Pending approval 1`] = `
|
||||
"<div class="ml-auto w-min">
|
||||
<div class="flex flex-col">
|
||||
<div data-oruga="dropdown" class="o-drop o-drop--position-bottom-left">
|
||||
<div tabindex="0" class="o-drop__trigger" aria-haspopup="true"><button type="button" class="o-btn o-btn--large o-btn--success" role="button" data-oruga="button"><span class="o-btn__wrapper"><!----><span class="o-btn__label"><template class="flex items-center"></template></span>
|
||||
<!----></span>
|
||||
</button></div>
|
||||
<!--teleport start-->
|
||||
<transition-stub name="fade" appear="false" persisted="false" css="true">
|
||||
<!---->
|
||||
</transition-stub>
|
||||
<transition-stub name="fade" appear="false" persisted="false" css="true">
|
||||
<div class="o-drop__menu o-drop__menu--bottom-left" role="list" aria-hidden="true" aria-modal="true" style="display: none;">
|
||||
<div class="o-drop__item o-drop__item--clickable" role="listitem" tabindex="0" data-oruga="dropdown-item">Change my identity…</div>
|
||||
<div class="o-drop__item o-drop__item--clickable" role="listitem" tabindex="0" data-oruga="dropdown-item">Cancel my participation request…</div>
|
||||
</div>
|
||||
</transition-stub>
|
||||
<!--teleport end-->
|
||||
</div>
|
||||
<p>Participation requested!</p>
|
||||
<p>Waiting for organization team approval.</p>
|
||||
</div>
|
||||
</div>"
|
||||
`;
|
||||
|
||||
exports[`ParticipationButton > Show Rejected 1`] = `
|
||||
"<div class="ml-auto w-min">
|
||||
<div><span>Unfortunately, your participation request was rejected by the organizers.</span></div>
|
||||
</div>"
|
||||
`;
|
||||
|
||||
exports[`ParticipationButton > Show Unlogged 1`] = `
|
||||
"<div class="ml-auto w-min"><a href="/events/0123456789/participate/with-account" class="o-btn o-btn--large o-btn--primary" role="button" data-oruga="button" rel="nofollow"><span class="o-btn__wrapper"><!----><span class="o-btn__label">Participate</span>
|
||||
<!----></span>
|
||||
</a></div>"
|
||||
`;
|
||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1,62 @@
|
||||
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
|
||||
|
||||
exports[`SkeletonEventResult > Show column 1`] = `
|
||||
"<div class="bg-white dark:bg-slate-800 shadow rounded-md max-w-sm w-full mx-auto">
|
||||
<div class="animate-pulse flex flex-col items-center md:flex-col">
|
||||
<div class="object-cover h-56 w-full md:max-w-[20rem] bg-slate-700"></div>
|
||||
<div class="flex-1 space-3-4 flex self-start flex-col justify-between p-2 md:p-4 w-full"><span class="h-2 bg-slate-700"></span><span class="mb-2 h-4 bg-slate-700"></span>
|
||||
<div class="flex space-x-4 flex-row">
|
||||
<div class="rounded-full bg-slate-700 h-10 w-10"></div>
|
||||
<div class="flex flex-col flex-1 space-y-2">
|
||||
<div class="h-3 bg-slate-700"></div>
|
||||
<div class="h-2 bg-slate-700"></div>
|
||||
</div>
|
||||
</div>
|
||||
<!--v-if-->
|
||||
<!--v-if-->
|
||||
</div>
|
||||
</div>
|
||||
</div>"
|
||||
`;
|
||||
|
||||
exports[`SkeletonEventResult > Show not minimal 1`] = `
|
||||
"<div class="bg-white dark:bg-slate-800 shadow rounded-md max-w-4xl w-full mx-auto">
|
||||
<div class="animate-pulse flex flex-col items-center md:flex-row">
|
||||
<div class="object-cover h-56 w-full md:max-w-[20rem] bg-slate-700"></div>
|
||||
<div class="flex-1 space-3-4 flex self-start flex-col justify-between p-2 md:p-4 w-full"><span class="h-2 bg-slate-700"></span><span class="mb-2 h-4 bg-slate-700"></span>
|
||||
<div class="flex space-x-4 flex-row">
|
||||
<div class="rounded-full bg-slate-700 h-10 w-10"></div>
|
||||
<div class="flex flex-col flex-1 space-y-2">
|
||||
<div class="h-3 bg-slate-700"></div>
|
||||
<div class="h-2 bg-slate-700"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="h-3 bg-slate-700 mt-3 w-60"></div>
|
||||
<div class="flex">
|
||||
<div class="h-3 bg-slate-700 mt-2 w-20 mr-2 rounded"></div>
|
||||
<div class="h-3 bg-slate-700 mt-2 w-20 mr-2 rounded"></div>
|
||||
<div class="h-3 bg-slate-700 mt-2 w-20 mr-2 rounded"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>"
|
||||
`;
|
||||
|
||||
exports[`SkeletonEventResult > Show row 1`] = `
|
||||
"<div class="bg-white dark:bg-slate-800 shadow rounded-md max-w-4xl w-full mx-auto">
|
||||
<div class="animate-pulse flex flex-col items-center md:flex-row">
|
||||
<div class="object-cover h-56 w-full md:max-w-[20rem] bg-slate-700"></div>
|
||||
<div class="flex-1 space-3-4 flex self-start flex-col justify-between p-2 md:p-4 w-full"><span class="h-2 bg-slate-700"></span><span class="mb-2 h-4 bg-slate-700"></span>
|
||||
<div class="flex space-x-4 flex-row">
|
||||
<div class="rounded-full bg-slate-700 h-10 w-10"></div>
|
||||
<div class="flex flex-col flex-1 space-y-2">
|
||||
<div class="h-3 bg-slate-700"></div>
|
||||
<div class="h-2 bg-slate-700"></div>
|
||||
</div>
|
||||
</div>
|
||||
<!--v-if-->
|
||||
<!--v-if-->
|
||||
</div>
|
||||
</div>
|
||||
</div>"
|
||||
`;
|
||||
@@ -0,0 +1,42 @@
|
||||
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
|
||||
|
||||
exports[`TagInput > Show new 1`] = `
|
||||
"<div data-oruga="field" class="o-field taginput-field"><label for="tag-input-1" class="o-field__label">
|
||||
<p class="inline-flex items-center gap-0.5">Add some tags
|
||||
<div class="o-tip" data-oruga="tooltip">
|
||||
<!--teleport start-->
|
||||
<transition-stub name="fade" appear="false" persisted="false" css="true">
|
||||
<div class="o-tip__content o-tip__content--auto o-tip__content--dark" style="display: none;"><span class="o-tip__arrow o-tip__arrow--auto o-tip__arrow--dark"></span>You can add tags by hitting the Enter key or by adding a comma</div>
|
||||
</transition-stub>
|
||||
<!--teleport end-->
|
||||
<div class="o-tip__trigger" aria-haspopup="true"><span aria-hidden="true" class="material-design-icon help-circle-outline-icon" role="img"><svg fill="currentColor" class="material-design-icon__svg" width="16" height="16" viewBox="0 0 24 24"><path d="M11,18H13V16H11V18M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2M12,20C7.59,20 4,16.41 4,12C4,7.59 7.59,4 12,4C16.41,4 20,7.59 20,12C20,16.41 16.41,20 12,20M12,6A4,4 0 0,0 8,10H10A2,2 0 0,1 12,8A2,2 0 0,1 14,10C14,12 11,11.75 11,15H13C13,12.75 16,12.5 16,10A4,4 0 0,0 12,6Z"><!--v-if--></path></svg></span></div>
|
||||
</div>
|
||||
</p>
|
||||
</label>
|
||||
<div class="o-field__body">
|
||||
<div class="o-field o-field--addons">
|
||||
<div data-oruga="taginput" class="o-taginput o-taginput--expanded">
|
||||
<div class="o-taginput__container"><span class="o-taginput__item"><span>Hello</span><span class="o-icon o-icon--clickable o-taginput__item__close" data-oruga="icon"><i class="mdi mdi-close mdi-24px"></i></span></span>
|
||||
<div data-oruga="autocomplete" class="o-drop o-drop--expanded o-drop--position-auto o-acp o-taginput__autocomplete">
|
||||
<div tabindex="-1" class="o-drop__trigger" aria-haspopup="listbox">
|
||||
<div data-oruga="input" class="o-input__wrapper o-input__wrapper--expanded"><input dir="auto" has-counter="false" role="combobox" aria-autocomplete="list" aria-controls="" aria-expanded="false" id="tag-input-1" data-oruga-input="text" type="text" class="o-input o-taginput__input o-input--iconspace-left" maxlength="20" autocomplete="off" placeholder="Eg: Stockholm, Dance, Chess…"><span class="o-icon o-input__icon-left" data-oruga="icon"><i class="mdi mdi-label mdi-24px"></i></span>
|
||||
<!---->
|
||||
<!---->
|
||||
</div>
|
||||
</div>
|
||||
<!--teleport start-->
|
||||
<transition-stub name="fade" appear="false" persisted="false" css="true">
|
||||
<!---->
|
||||
</transition-stub>
|
||||
<transition-stub name="fade" appear="false" persisted="false" css="true">
|
||||
<div id="" tabindex="-1" class="o-drop__menu o-drop__menu--auto" style="max-height: 200px; overflow: auto; display: none;" role="listbox" aria-hidden="true" aria-modal="false"></div>
|
||||
</transition-stub>
|
||||
<!--teleport end-->
|
||||
</div>
|
||||
</div><small class="o-taginput__counter">1 / 10</small>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!---->
|
||||
</div>"
|
||||
`;
|
||||
111
tests/unit/specs/components/Group/GroupCard.spec.ts
Normal file
111
tests/unit/specs/components/Group/GroupCard.spec.ts
Normal file
@@ -0,0 +1,111 @@
|
||||
import { beforeEach, describe, it, expect } from "vitest";
|
||||
import { enUS } from "date-fns/locale";
|
||||
import { routes } from "@/router";
|
||||
import { createRouter, createWebHistory, Router } from "vue-router";
|
||||
import { config, mount } from "@vue/test-utils";
|
||||
import { Oruga } from "@oruga-ui/oruga-next";
|
||||
import flushPromises from "flush-promises";
|
||||
import { getMockClient } from "../../mocks/client";
|
||||
import { htmlRemoveId } from "../../common";
|
||||
import GroupCard from "@/components/Group/GroupCard.vue";
|
||||
import { IGroup } from "@/types/actor";
|
||||
|
||||
config.global.plugins.push(Oruga);
|
||||
|
||||
let router: Router;
|
||||
|
||||
beforeEach(async () => {
|
||||
router = createRouter({
|
||||
history: createWebHistory(),
|
||||
routes: routes,
|
||||
});
|
||||
|
||||
// await router.isReady();
|
||||
});
|
||||
|
||||
const basicGroup: IGroup = {
|
||||
name: "Framasoft",
|
||||
preferredUsername: "framasoft",
|
||||
avatar: null,
|
||||
domain: "mobilizon.fr",
|
||||
url: "",
|
||||
summary: "",
|
||||
suspended: false,
|
||||
members: { total: 0, elements: [] },
|
||||
followers: { total: 0, elements: [] },
|
||||
};
|
||||
|
||||
const groupWithMedia: IGroup = {
|
||||
...basicGroup,
|
||||
banner: {
|
||||
url: "https://mobilizon.fr/media/a8227a16cc80b3d20ff5ee549a29c1b20a0ca1547f8861129aae9f00c3c69d12.jpg?name=framasoft%27s%20banner.jpg",
|
||||
},
|
||||
avatar: {
|
||||
url: "https://mobilizon.fr/media/890f5396ef80081a6b1b18a5db969746cf8bb340e8a4e657d665e41f6646c539.jpg?name=framasoft%27s%20avatar.jpg",
|
||||
},
|
||||
};
|
||||
|
||||
const groupWithFollowersOrMembers: IGroup = {
|
||||
...groupWithMedia,
|
||||
members: { total: 2, elements: [] },
|
||||
followers: { total: 5, elements: [] },
|
||||
summary:
|
||||
"You can also use variant modifiers to target media queries like responsive breakpoints, dark mode, prefers-reduced-motion, and more. For example, use md:h-full to apply the h-full utility at only medium screen sizes and above.",
|
||||
physicalAddress: {
|
||||
description: "Nantes",
|
||||
},
|
||||
};
|
||||
|
||||
const generateWrapper = (props: any = {}) => {
|
||||
const global_data = getMockClient([]);
|
||||
global_data.provide.dateFnsLocale = enUS;
|
||||
global_data.plugins = [router];
|
||||
return mount(GroupCard, {
|
||||
props: props,
|
||||
global: {
|
||||
...global_data,
|
||||
stubs: {
|
||||
RouterLink: false,
|
||||
},
|
||||
},
|
||||
});
|
||||
};
|
||||
|
||||
describe("GroupCard", () => {
|
||||
it("Show Empty", async () => {
|
||||
const wrapper = generateWrapper({
|
||||
group: basicGroup,
|
||||
});
|
||||
await wrapper.vm.$nextTick();
|
||||
await flushPromises();
|
||||
expect(htmlRemoveId(wrapper.html())).toMatchSnapshot();
|
||||
});
|
||||
|
||||
it("Show With media", async () => {
|
||||
const wrapper = generateWrapper({
|
||||
group: groupWithMedia,
|
||||
});
|
||||
await wrapper.vm.$nextTick();
|
||||
await flushPromises();
|
||||
expect(htmlRemoveId(wrapper.html())).toMatchSnapshot();
|
||||
});
|
||||
|
||||
it("Show with followers or members", async () => {
|
||||
const wrapper = generateWrapper({
|
||||
group: groupWithFollowersOrMembers,
|
||||
});
|
||||
await wrapper.vm.$nextTick();
|
||||
await flushPromises();
|
||||
expect(htmlRemoveId(wrapper.html())).toMatchSnapshot();
|
||||
});
|
||||
|
||||
it("Show Row mode", async () => {
|
||||
const wrapper = generateWrapper({
|
||||
group: groupWithFollowersOrMembers,
|
||||
mode: "row",
|
||||
});
|
||||
await wrapper.vm.$nextTick();
|
||||
await flushPromises();
|
||||
expect(htmlRemoveId(wrapper.html())).toMatchSnapshot();
|
||||
});
|
||||
});
|
||||
@@ -1,58 +0,0 @@
|
||||
import { beforeEach, describe, it, expect } from "vitest";
|
||||
import { enUS } from "date-fns/locale";
|
||||
import { routes } from "@/router";
|
||||
import { createRouter, createWebHistory, Router } from "vue-router";
|
||||
import { config, mount } from "@vue/test-utils";
|
||||
import { Oruga } from "@oruga-ui/oruga-next";
|
||||
import flushPromises from "flush-promises";
|
||||
import { getMockClient, requestHandlers } from "../../mocks/client";
|
||||
import { htmlRemoveId } from "../../common";
|
||||
import GroupFollowers from "@/views/Group/GroupFollowers.vue";
|
||||
import { GROUP_FOLLOWERS, UPDATE_FOLLOWER } from "@/graphql/followers";
|
||||
|
||||
config.global.plugins.push(Oruga);
|
||||
|
||||
let router: Router;
|
||||
|
||||
beforeEach(async () => {
|
||||
router = createRouter({
|
||||
history: createWebHistory(),
|
||||
routes: routes,
|
||||
});
|
||||
|
||||
// await router.isReady();
|
||||
});
|
||||
|
||||
const generateWrapper = () => {
|
||||
const global_data = getMockClient([GROUP_FOLLOWERS, UPDATE_FOLLOWER]);
|
||||
global_data.provide.dateFnsLocale = enUS;
|
||||
global_data.plugins = [router];
|
||||
return mount(GroupFollowers, {
|
||||
props: {
|
||||
preferredUsername: "my-group",
|
||||
},
|
||||
global: {
|
||||
...global_data,
|
||||
stubs: {
|
||||
RouterLink: false,
|
||||
},
|
||||
},
|
||||
});
|
||||
};
|
||||
|
||||
describe("GroupFollowers", () => {
|
||||
it("Show simple", async () => {
|
||||
const wrapper = generateWrapper();
|
||||
await wrapper.vm.$nextTick();
|
||||
await flushPromises();
|
||||
expect(htmlRemoveId(wrapper.html())).toMatchSnapshot();
|
||||
expect(requestHandlers.handle_0).toHaveBeenCalledTimes(1);
|
||||
expect(requestHandlers.handle_1).toHaveBeenCalledTimes(0);
|
||||
expect(requestHandlers.handle_0).toHaveBeenCalledWith({
|
||||
approved: true,
|
||||
followersLimit: 10,
|
||||
followersPage: 1,
|
||||
name: "my-group",
|
||||
});
|
||||
});
|
||||
});
|
||||
120
tests/unit/specs/components/Group/GroupMemberCard.spec.ts
Normal file
120
tests/unit/specs/components/Group/GroupMemberCard.spec.ts
Normal file
@@ -0,0 +1,120 @@
|
||||
import { beforeEach, describe, it, expect } from "vitest";
|
||||
import { enUS } from "date-fns/locale";
|
||||
import { routes } from "@/router";
|
||||
import { createRouter, createWebHistory, Router } from "vue-router";
|
||||
import { config, mount } from "@vue/test-utils";
|
||||
import { Oruga } from "@oruga-ui/oruga-next";
|
||||
import flushPromises from "flush-promises";
|
||||
import { getMockClient } from "../../mocks/client";
|
||||
import { htmlRemoveId } from "../../common";
|
||||
import GroupMemberCard from "@/components/Group/GroupMemberCard.vue";
|
||||
import { IActor } from "@/types/actor";
|
||||
import { IMember } from "@/types/actor/member.model";
|
||||
import { MemberRole } from "@/types/enums";
|
||||
|
||||
config.global.plugins.push(Oruga);
|
||||
|
||||
let router: Router;
|
||||
|
||||
beforeEach(async () => {
|
||||
router = createRouter({
|
||||
history: createWebHistory(),
|
||||
routes: routes,
|
||||
});
|
||||
|
||||
// await router.isReady();
|
||||
});
|
||||
|
||||
const generateWrapper = (props: any) => {
|
||||
const global_data = getMockClient([]);
|
||||
global_data.provide.dateFnsLocale = enUS;
|
||||
global_data.plugins = [router];
|
||||
return mount(GroupMemberCard, {
|
||||
props: props,
|
||||
global: {
|
||||
...global_data,
|
||||
stubs: {
|
||||
RouterLink: false,
|
||||
},
|
||||
},
|
||||
});
|
||||
};
|
||||
|
||||
const baseActorAvatar = {
|
||||
id: "",
|
||||
name: "",
|
||||
alt: "",
|
||||
metadata: {},
|
||||
url: "https://social.tcit.fr/system/accounts/avatars/000/000/001/original/a28c50ce5f2b13fd.jpg",
|
||||
};
|
||||
|
||||
const basePerson: IActor = {
|
||||
name: "Thomas Citharel",
|
||||
preferredUsername: "tcit",
|
||||
avatar: baseActorAvatar,
|
||||
domain: null,
|
||||
url: "",
|
||||
summary: "",
|
||||
suspended: false,
|
||||
};
|
||||
|
||||
const basicGroup: IActor = {
|
||||
name: "Framasoft",
|
||||
preferredUsername: "framasoft",
|
||||
avatar: {
|
||||
url: "https://mobilizon.fr/media/ff5b2d425fb73e17fcbb56a1a032359ee0b21453c11af59e103e783817a32fdf.png?name=framasoft%27s%20avatar.png",
|
||||
},
|
||||
domain: "mobilizon.fr",
|
||||
url: "",
|
||||
summary: `<p><strong>La Fediverse</strong>, <strong>c'est la <em><u>Féd</u>ération qui englobe l'Un<u>ivers</u> des réseaux sociaux libres et décentralisés,</em> </strong>dont Mobilizon (évènements), Mastodon (microblog), Peertube (vidéos), Pixelfed (photos), Funkwhale (musique), Matrix (messagerie instantanée)... et tant d'autres font partie.</p><p><strong>Et "La Fediverse <em>Nantaise</em>" est un collectif cherchant à faire connaître localement tout le potentiel de ces réseaux ! :-)</strong></p>`,
|
||||
suspended: false,
|
||||
members: { total: 0, elements: [] },
|
||||
followers: { total: 0, elements: [] },
|
||||
};
|
||||
|
||||
const basicMember: IMember = {
|
||||
parent: basicGroup as IActor,
|
||||
actor: basePerson,
|
||||
role: MemberRole.MEMBER,
|
||||
};
|
||||
|
||||
const moderatorMember: IMember = {
|
||||
parent: basicGroup,
|
||||
actor: basePerson,
|
||||
role: MemberRole.MODERATOR,
|
||||
};
|
||||
|
||||
const adminMember: IMember = {
|
||||
parent: basicGroup,
|
||||
actor: basePerson,
|
||||
role: MemberRole.ADMINISTRATOR,
|
||||
};
|
||||
|
||||
describe("GroupMemberCard", () => {
|
||||
it("Show simple member", async () => {
|
||||
const wrapper = generateWrapper({
|
||||
member: basicMember,
|
||||
});
|
||||
await wrapper.vm.$nextTick();
|
||||
await flushPromises();
|
||||
expect(htmlRemoveId(wrapper.html())).toMatchSnapshot();
|
||||
});
|
||||
|
||||
it("Show moderator", async () => {
|
||||
const wrapper = generateWrapper({
|
||||
member: moderatorMember,
|
||||
});
|
||||
await wrapper.vm.$nextTick();
|
||||
await flushPromises();
|
||||
expect(htmlRemoveId(wrapper.html())).toMatchSnapshot();
|
||||
});
|
||||
|
||||
it("Show administrator", async () => {
|
||||
const wrapper = generateWrapper({
|
||||
member: adminMember,
|
||||
});
|
||||
await wrapper.vm.$nextTick();
|
||||
await flushPromises();
|
||||
expect(htmlRemoveId(wrapper.html())).toMatchSnapshot();
|
||||
});
|
||||
});
|
||||
@@ -1,79 +0,0 @@
|
||||
import { beforeEach, describe, it, expect } from "vitest";
|
||||
import { enUS } from "date-fns/locale";
|
||||
import { routes } from "@/router";
|
||||
import { createRouter, createWebHistory, Router } from "vue-router";
|
||||
import { config, mount } from "@vue/test-utils";
|
||||
import { Oruga } from "@oruga-ui/oruga-next";
|
||||
import flushPromises from "flush-promises";
|
||||
import { getMockClient, requestHandlers } from "../../mocks/client";
|
||||
import { htmlRemoveId } from "../../common";
|
||||
import GroupView from "@/views/Group/GroupView.vue";
|
||||
import { FETCH_GROUP_PUBLIC } from "@/graphql/group";
|
||||
import { JOIN_GROUP } from "@/graphql/member";
|
||||
import {
|
||||
GROUP_MEMBERSHIP_SUBSCRIPTION_CHANGED,
|
||||
PERSON_STATUS_GROUP,
|
||||
} from "@/graphql/actor";
|
||||
import {
|
||||
FOLLOW_GROUP,
|
||||
UNFOLLOW_GROUP,
|
||||
UPDATE_GROUP_FOLLOW,
|
||||
} from "@/graphql/followers";
|
||||
|
||||
config.global.plugins.push(Oruga);
|
||||
|
||||
let router: Router;
|
||||
|
||||
beforeEach(async () => {
|
||||
router = createRouter({
|
||||
history: createWebHistory(),
|
||||
routes: routes,
|
||||
});
|
||||
|
||||
// await router.isReady();
|
||||
});
|
||||
|
||||
const generateWrapper = () => {
|
||||
const global_data = getMockClient([
|
||||
FETCH_GROUP_PUBLIC,
|
||||
JOIN_GROUP,
|
||||
GROUP_MEMBERSHIP_SUBSCRIPTION_CHANGED,
|
||||
PERSON_STATUS_GROUP,
|
||||
FOLLOW_GROUP,
|
||||
UNFOLLOW_GROUP,
|
||||
UPDATE_GROUP_FOLLOW,
|
||||
]);
|
||||
global_data.provide.dateFnsLocale = enUS;
|
||||
global_data.plugins = [router];
|
||||
return mount(GroupView, {
|
||||
props: {
|
||||
preferredUsername: "my-group",
|
||||
},
|
||||
global: {
|
||||
...global_data,
|
||||
stubs: {
|
||||
RouterLink: false,
|
||||
},
|
||||
},
|
||||
});
|
||||
};
|
||||
|
||||
describe("GroupView", () => {
|
||||
it("Show simple", async () => {
|
||||
const wrapper = generateWrapper();
|
||||
await wrapper.vm.$nextTick();
|
||||
await flushPromises();
|
||||
expect(htmlRemoveId(wrapper.html())).toMatchSnapshot();
|
||||
expect(requestHandlers.handle_0).toHaveBeenCalledTimes(1);
|
||||
expect(requestHandlers.handle_1).toHaveBeenCalledTimes(0);
|
||||
expect(requestHandlers.handle_2).toHaveBeenCalledTimes(0);
|
||||
expect(requestHandlers.handle_3).toHaveBeenCalledTimes(0);
|
||||
expect(requestHandlers.handle_4).toHaveBeenCalledTimes(0);
|
||||
expect(requestHandlers.handle_5).toHaveBeenCalledTimes(0);
|
||||
expect(requestHandlers.handle_6).toHaveBeenCalledTimes(0);
|
||||
expect(requestHandlers.handle_0).toHaveBeenCalledWith({
|
||||
name: "my-group",
|
||||
afterDateTime: new Date("2022-02-02T02:04:00.000Z"),
|
||||
});
|
||||
});
|
||||
});
|
||||
@@ -1,138 +0,0 @@
|
||||
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
|
||||
|
||||
exports[`CreateView > Show simple 1`] = `
|
||||
"<section class="container mx-auto">
|
||||
<h1>Create a new group</h1>
|
||||
<form>
|
||||
<div data-oruga="field" class="o-field"><label for="group-display-name" class="o-field__label">Group display name</label>
|
||||
<div class="o-field__body">
|
||||
<div class="o-field o-field--addons">
|
||||
<div data-oruga="input" class="o-input__wrapper o-input__wrapper--expanded"><input aria-required="true" required="" id="group-display-name" data-oruga-input="text" type="text" class="o-input" autocomplete="off">
|
||||
<!---->
|
||||
<!---->
|
||||
<!---->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!---->
|
||||
</div>
|
||||
<div class="field"><label class="label" for="group-preferred-username">Federated Group Name</label>
|
||||
<div class="field-body">
|
||||
<div data-oruga="field" class="o-field">
|
||||
<!---->
|
||||
<div class="o-field__body">
|
||||
<div class="o-field o-field--addons">
|
||||
<div data-oruga="input" class="o-input__wrapper o-input__wrapper--expanded"><input aria-required="true" required="" pattern="[a-z0-9_]+" id="group-preferred-username" data-oruga-input="text" type="text" class="o-input" autocomplete="off">
|
||||
<!---->
|
||||
<!---->
|
||||
<!---->
|
||||
</div>
|
||||
<p class="control"><span class="button is-static">@localhost</span></p>
|
||||
</div>
|
||||
</div>
|
||||
<p class="o-field__message">Only alphanumeric lowercased characters and underscores are supported.</p>
|
||||
</div>
|
||||
</div>
|
||||
<!--v-if-->
|
||||
</div>
|
||||
<div data-oruga="field" class="o-field"><label for="group-summary" class="o-field__label">Description</label>
|
||||
<div class="o-field__body">
|
||||
<div class="o-field o-field--addons"></div>
|
||||
</div>
|
||||
<!---->
|
||||
</div>
|
||||
<div class="address-autocomplete">
|
||||
<div data-oruga="field" class="o-field !-mt-2" id="FullAddressAutoComplete-o-field"><label for="full-address-autocomplete-1" class="o-field__label">Group address</label>
|
||||
<div class="o-field__body">
|
||||
<div class="o-field o-field--addons">
|
||||
<!--v-if-->
|
||||
<div data-oruga="autocomplete" class="o-drop o-drop--expanded o-drop--position-auto o-acp">
|
||||
<div tabindex="-1" class="o-drop__trigger" aria-haspopup="listbox">
|
||||
<div data-oruga="input" class="o-input__wrapper o-input__wrapper--expanded"><input dir="auto" class="FullAddressAutoComplete-o-autocomplete !mt-0 !h-full o-input o-input--iconspace-left" role="combobox" aria-autocomplete="list" aria-controls="" aria-expanded="false" id="full-address-autocomplete-1" data-oruga-input="text" type="text" autocomplete="off" placeholder="e.g. 10 Rue Jangot"><span class="o-icon o-input__icon-left" data-oruga="icon"><i class="mdi mdi-map-marker mdi-24px"></i></span>
|
||||
<!---->
|
||||
<!---->
|
||||
</div>
|
||||
</div>
|
||||
<!--teleport start-->
|
||||
<transition-stub name="fade" appear="false" persisted="false" css="true">
|
||||
<!---->
|
||||
</transition-stub>
|
||||
<transition-stub name="fade" appear="false" persisted="false" css="true">
|
||||
<div id="" tabindex="-1" class="o-drop__menu o-drop__menu--auto" style="max-height: 200px; overflow: auto; display: none;" role="listbox" aria-hidden="true" aria-modal="false">
|
||||
<!---->
|
||||
<!---->
|
||||
<div class="o-drop__item o-drop__item--clickable o-acp__item o-acp__item--empty" role="listitem" tabindex="0" data-oruga="dropdown-item"></div>
|
||||
<!---->
|
||||
</div>
|
||||
</transition-stub>
|
||||
<!--teleport end-->
|
||||
</div><button disabled="" type="button" class="o-btn o-btn--disabled reset-area !h-auto" role="button" data-oruga="button" title="Clear address field"><span class="o-btn__wrapper"><span class="o-icon o-btn__icon o-btn__icon-left" data-oruga="icon"><i class="mdi mdi-close mdi-24px"></i></span>
|
||||
<!---->
|
||||
<!----></span>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<!---->
|
||||
</div>
|
||||
<!--v-if-->
|
||||
<!--v-if-->
|
||||
</div>
|
||||
<!--v-if-->
|
||||
<!--v-if-->
|
||||
<div class="field"><b class="field-label">Avatar</b>
|
||||
<div><label class="o-upl !flex" data-oruga="upload">
|
||||
<div class="o-upl__draggable" role="button" tabindex="0">
|
||||
<div class="w-100 text-center p-4 rounded-xl border-dashed border-2 border-gray-600"><span class="mx-auto flex w-fit"><span aria-hidden="true" class="material-design-icon upload-icon" role="img"><svg fill="currentColor" class="material-design-icon__svg" width="24" height="24" viewBox="0 0 24 24"><path d="M9,16V10H5L12,3L19,10H15V16H9M5,20V18H19V20H5Z"><!--v-if--></path></svg></span><span class="capitalize">Click to upload Avatar</span></span>
|
||||
<!--v-if-->
|
||||
<!--v-if-->
|
||||
</div>
|
||||
</div><input type="file" data-oruga-input="file" accept="image/gif,image/png,image/jpeg,image/webp">
|
||||
</label></div>
|
||||
<!--v-if-->
|
||||
</div>
|
||||
<div class="field"><b class="field-label">Banner</b>
|
||||
<div><label class="o-upl !flex" data-oruga="upload">
|
||||
<div class="o-upl__draggable" role="button" tabindex="0">
|
||||
<div class="w-100 text-center p-4 rounded-xl border-dashed border-2 border-gray-600"><span class="mx-auto flex w-fit"><span aria-hidden="true" class="material-design-icon upload-icon" role="img"><svg fill="currentColor" class="material-design-icon__svg" width="24" height="24" viewBox="0 0 24 24"><path d="M9,16V10H5L12,3L19,10H15V16H9M5,20V18H19V20H5Z"><!--v-if--></path></svg></span><span class="capitalize">Click to upload Banner</span></span>
|
||||
<!--v-if-->
|
||||
<!--v-if-->
|
||||
</div>
|
||||
</div><input type="file" data-oruga-input="file" accept="image/gif,image/png,image/jpeg,image/webp">
|
||||
</label></div>
|
||||
<!--v-if-->
|
||||
</div>
|
||||
<fieldset>
|
||||
<legend class="field-label !mb-0 mt-2">Group visibility</legend><label class="o-radio o-radio--checked" data-oruga="radio" role="radio" aria-checked="true"><input type="radio" data-oruga-input="radio" class="o-radio__input o-radio__input--checked" name="groupVisibility" autocomplete="off" value="PUBLIC"><span class="o-radio__label">Visible everywhere on the web<br><small>The group will be publicly listed in search results and may be suggested in the explore section. Only public informations will be shown on it's page.</small></span></label><label class="o-radio" data-oruga="radio" role="radio" aria-checked="false"><input type="radio" data-oruga-input="radio" class="o-radio__input" name="groupVisibility" autocomplete="off" value="UNLISTED"><span class="o-radio__label">Only accessible through link<br><small>You'll need to transmit the group URL so people may access the group's profile. The group won't be findable in Mobilizon's search or regular search engines.</small></span></label>
|
||||
</fieldset>
|
||||
<fieldset>
|
||||
<legend class="mt-2"><span class="field-label !mb-0">New members</span><span>Members will also access private sections like discussions, resources and restricted posts.</span></legend>
|
||||
<div data-oruga="field" class="o-field">
|
||||
<!---->
|
||||
<div class="o-field__body">
|
||||
<div class="o-field o-field--addons"><label class="o-radio" data-oruga="radio" role="radio" aria-checked="false"><input type="radio" data-oruga-input="radio" class="o-radio__input" name="groupOpenness" autocomplete="off" value="OPEN"><span class="o-radio__label">Anyone can join freely<br><small>Anyone wanting to be a member from your group will be able to from your group page.</small></span></label></div>
|
||||
</div>
|
||||
<!---->
|
||||
</div>
|
||||
<div data-oruga="field" class="o-field">
|
||||
<!---->
|
||||
<div class="o-field__body">
|
||||
<div class="o-field o-field--addons"><label class="o-radio o-radio--checked" data-oruga="radio" role="radio" aria-checked="true"><input type="radio" data-oruga-input="radio" class="o-radio__input o-radio__input--checked" name="groupOpenness" autocomplete="off" value="MODERATED"><span class="o-radio__label">Moderate new members<br><small>Anyone can request being a member, but an administrator needs to approve the membership.</small></span></label></div>
|
||||
</div>
|
||||
<!---->
|
||||
</div>
|
||||
<div data-oruga="field" class="o-field">
|
||||
<!---->
|
||||
<div class="o-field__body">
|
||||
<div class="o-field o-field--addons"><label class="o-radio" data-oruga="radio" role="radio" aria-checked="false"><input type="radio" data-oruga-input="radio" class="o-radio__input" name="groupOpenness" autocomplete="off" value="INVITE_ONLY"><span class="o-radio__label">Manually invite new members<br><small>The only way for your group to get new members is if an admininistrator invites them.</small></span></label></div>
|
||||
</div>
|
||||
<!---->
|
||||
</div>
|
||||
</fieldset>
|
||||
<fieldset>
|
||||
<legend class="mt-2"><span class="field-label !mb-0">Followers</span><span>Followers will receive new public events and posts.</span></legend><label class="o-chk" data-oruga="checkbox" role="checkbox" aria-checked="false"><input type="checkbox" data-oruga-input="checkbox" class="o-chk__input" autocomplete="off" true-value="true" false-value="false"><span class="o-chk__label">Manually approve new followers</span></label>
|
||||
</fieldset><button type="submit" class="o-btn o-btn--primary mt-3" role="button" data-oruga="button"><span class="o-btn__wrapper"><!----><span class="o-btn__label">Create my group</span>
|
||||
<!----></span>
|
||||
</button>
|
||||
</form>
|
||||
</section>"
|
||||
`;
|
||||
@@ -0,0 +1,79 @@
|
||||
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
|
||||
|
||||
exports[`GroupCard > Show Empty 1`] = `
|
||||
"<a href="/@framasoft@mobilizon.fr" class="mbz-card snap-center shrink-0 dark:bg-mbz-purple dark:text-white rounded-lg shadow-lg flex items-center flex-col sm:max-w-xs w-[18rem] shrink-0 flex flex-col">
|
||||
<div class="flex-none p-2 md:p-4"><span aria-hidden="true" class="material-design-icon account-group-icon" role="img"><svg fill="currentColor" class="material-design-icon__svg" width="128" height="128" viewBox="0 0 24 24"><path d="M12,5.5A3.5,3.5 0 0,1 15.5,9A3.5,3.5 0 0,1 12,12.5A3.5,3.5 0 0,1 8.5,9A3.5,3.5 0 0,1 12,5.5M5,8C5.56,8 6.08,8.15 6.53,8.42C6.38,9.85 6.8,11.27 7.66,12.38C7.16,13.34 6.16,14 5,14A3,3 0 0,1 2,11A3,3 0 0,1 5,8M19,8A3,3 0 0,1 22,11A3,3 0 0,1 19,14C17.84,14 16.84,13.34 16.34,12.38C17.2,11.27 17.62,9.85 17.47,8.42C17.92,8.15 18.44,8 19,8M5.5,18.25C5.5,16.18 8.41,14.5 12,14.5C15.59,14.5 18.5,16.18 18.5,18.25V20H5.5V18.25M0,20V18.5C0,17.11 1.89,15.94 4.45,15.6C3.86,16.28 3.5,17.22 3.5,18.25V20H0M24,20H20.5V18.25C20.5,17.22 20.14,16.28 19.55,15.6C22.11,15.94 24,17.11 24,18.5V20Z"><!--v-if--></path></svg></span></div>
|
||||
<div class="py-2 px-2 md:px-4 flex flex-col h-full justify-between w-full">
|
||||
<div class="flex gap-1 mb-2">
|
||||
<div class="overflow-hidden flex-auto">
|
||||
<h3 class="text-2xl leading-5 line-clamp-3 font-bold text-violet-3 dark:text-white" dir="auto">Framasoft</h3><span class="block truncate">@framasoft@mobilizon.fr</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="mb-2 line-clamp-3" dir="auto"></div>
|
||||
<div>
|
||||
<!--v-if-->
|
||||
<!--v-if-->
|
||||
</div>
|
||||
</div>
|
||||
</a>"
|
||||
`;
|
||||
|
||||
exports[`GroupCard > Show Row mode 1`] = `
|
||||
"<a href="/@framasoft@mobilizon.fr" class="mbz-card snap-center shrink-0 dark:bg-mbz-purple dark:text-white rounded-lg shadow-lg flex items-center flex-col sm:flex-row">
|
||||
<div class="flex-none p-2 md:p-4">
|
||||
<figure class=""><img class="rounded-full" src="https://mobilizon.fr/media/890f5396ef80081a6b1b18a5db969746cf8bb340e8a4e657d665e41f6646c539.jpg?name=framasoft%27s%20avatar.jpg" alt="" height="128" width="128"></figure>
|
||||
</div>
|
||||
<div class="py-2 px-2 md:px-4 flex flex-col h-full justify-between w-full sm:flex-1">
|
||||
<div class="flex gap-1 mb-2">
|
||||
<div class="overflow-hidden flex-auto">
|
||||
<h3 class="text-2xl leading-5 line-clamp-3 font-bold text-violet-3 dark:text-white" dir="auto">Framasoft</h3><span class="block truncate">@framasoft@mobilizon.fr</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="mb-2 line-clamp-3" dir="auto">You can also use variant modifiers to target media queries like responsive breakpoints, dark mode, prefers-reduced-motion, and more. For example, use md:h-full to apply the h-full utility at only medium screen sizes and above.</div>
|
||||
<div>
|
||||
<div class="truncate flex gap-1" dir="auto" title="Nantes, undefined"><span aria-hidden="true" class="material-design-icon map-marker-icon" role="img"><svg fill="currentColor" class="material-design-icon__svg" width="24" height="24" viewBox="0 0 24 24"><path d="M12,11.5A2.5,2.5 0 0,1 9.5,9A2.5,2.5 0 0,1 12,6.5A2.5,2.5 0 0,1 14.5,9A2.5,2.5 0 0,1 12,11.5M12,2A7,7 0 0,0 5,9C5,14.25 12,22 12,22C12,22 19,14.25 19,9A7,7 0 0,0 12,2Z"><!--v-if--></path></svg></span><span>Nantes</span></div>
|
||||
<p class="flex gap-1"><span aria-hidden="true" class="material-design-icon account-icon" role="img"><svg fill="currentColor" class="material-design-icon__svg" width="24" height="24" viewBox="0 0 24 24"><path d="M12,4A4,4 0 0,1 16,8A4,4 0 0,1 12,12A4,4 0 0,1 8,8A4,4 0 0,1 12,4M12,14C16.42,14 20,15.79 20,18V20H4V18C4,15.79 7.58,14 12,14Z"><!--v-if--></path></svg></span> 7 members or followers</p>
|
||||
</div>
|
||||
</div>
|
||||
</a>"
|
||||
`;
|
||||
|
||||
exports[`GroupCard > Show With media 1`] = `
|
||||
"<a href="/@framasoft@mobilizon.fr" class="mbz-card snap-center shrink-0 dark:bg-mbz-purple dark:text-white rounded-lg shadow-lg flex items-center flex-col sm:max-w-xs w-[18rem] shrink-0 flex flex-col">
|
||||
<div class="flex-none p-2 md:p-4">
|
||||
<figure class=""><img class="rounded-full" src="https://mobilizon.fr/media/890f5396ef80081a6b1b18a5db969746cf8bb340e8a4e657d665e41f6646c539.jpg?name=framasoft%27s%20avatar.jpg" alt="" height="128" width="128"></figure>
|
||||
</div>
|
||||
<div class="py-2 px-2 md:px-4 flex flex-col h-full justify-between w-full">
|
||||
<div class="flex gap-1 mb-2">
|
||||
<div class="overflow-hidden flex-auto">
|
||||
<h3 class="text-2xl leading-5 line-clamp-3 font-bold text-violet-3 dark:text-white" dir="auto">Framasoft</h3><span class="block truncate">@framasoft@mobilizon.fr</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="mb-2 line-clamp-3" dir="auto"></div>
|
||||
<div>
|
||||
<!--v-if-->
|
||||
<!--v-if-->
|
||||
</div>
|
||||
</div>
|
||||
</a>"
|
||||
`;
|
||||
|
||||
exports[`GroupCard > Show with followers or members 1`] = `
|
||||
"<a href="/@framasoft@mobilizon.fr" class="mbz-card snap-center shrink-0 dark:bg-mbz-purple dark:text-white rounded-lg shadow-lg flex items-center flex-col sm:max-w-xs w-[18rem] shrink-0 flex flex-col">
|
||||
<div class="flex-none p-2 md:p-4">
|
||||
<figure class=""><img class="rounded-full" src="https://mobilizon.fr/media/890f5396ef80081a6b1b18a5db969746cf8bb340e8a4e657d665e41f6646c539.jpg?name=framasoft%27s%20avatar.jpg" alt="" height="128" width="128"></figure>
|
||||
</div>
|
||||
<div class="py-2 px-2 md:px-4 flex flex-col h-full justify-between w-full">
|
||||
<div class="flex gap-1 mb-2">
|
||||
<div class="overflow-hidden flex-auto">
|
||||
<h3 class="text-2xl leading-5 line-clamp-3 font-bold text-violet-3 dark:text-white" dir="auto">Framasoft</h3><span class="block truncate">@framasoft@mobilizon.fr</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="mb-2 line-clamp-3" dir="auto">You can also use variant modifiers to target media queries like responsive breakpoints, dark mode, prefers-reduced-motion, and more. For example, use md:h-full to apply the h-full utility at only medium screen sizes and above.</div>
|
||||
<div>
|
||||
<div class="truncate flex gap-1" dir="auto" title="Nantes, undefined"><span aria-hidden="true" class="material-design-icon map-marker-icon" role="img"><svg fill="currentColor" class="material-design-icon__svg" width="24" height="24" viewBox="0 0 24 24"><path d="M12,11.5A2.5,2.5 0 0,1 9.5,9A2.5,2.5 0 0,1 12,6.5A2.5,2.5 0 0,1 14.5,9A2.5,2.5 0 0,1 12,11.5M12,2A7,7 0 0,0 5,9C5,14.25 12,22 12,22C12,22 19,14.25 19,9A7,7 0 0,0 12,2Z"><!--v-if--></path></svg></span><span>Nantes</span></div>
|
||||
<p class="flex gap-1"><span aria-hidden="true" class="material-design-icon account-icon" role="img"><svg fill="currentColor" class="material-design-icon__svg" width="24" height="24" viewBox="0 0 24 24"><path d="M12,4A4,4 0 0,1 16,8A4,4 0 0,1 12,12A4,4 0 0,1 8,8A4,4 0 0,1 12,4M12,14C16.42,14 20,15.79 20,18V20H4V18C4,15.79 7.58,14 12,14Z"><!--v-if--></path></svg></span> 7 members or followers</p>
|
||||
</div>
|
||||
</div>
|
||||
</a>"
|
||||
`;
|
||||
@@ -1,11 +0,0 @@
|
||||
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
|
||||
|
||||
exports[`GroupFollowers > Show simple 1`] = `
|
||||
"<div>
|
||||
<!--v-if-->
|
||||
<transition-stub name="fade" appear="false" persisted="false" css="true">
|
||||
<!---->
|
||||
</transition-stub>
|
||||
<!--v-if-->
|
||||
</div>"
|
||||
`;
|
||||
@@ -0,0 +1,123 @@
|
||||
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
|
||||
|
||||
exports[`GroupMemberCard > Show administrator 1`] = `
|
||||
"<div class="rounded shadow-lg bg-white dark:bg-mbz-purple dark:text-white">
|
||||
<div class="bg-mbz-yellow-alt-50 text-black flex items-center gap-1 p-2 rounded-t-lg" dir="auto">
|
||||
<figure class=""><img class="rounded-xl" src="https://social.tcit.fr/system/accounts/avatars/000/000/001/original/a28c50ce5f2b13fd.jpg" alt="" width="24" height="24"></figure> Thomas Citharel (@tcit)
|
||||
</div>
|
||||
<div class="flex items-center gap-2 p-2 pr-4" dir="auto">
|
||||
<div class="flex-1">
|
||||
<div class="p-2 flex gap-2">
|
||||
<div class="">
|
||||
<figure class="h-12 w-12"><img class="rounded-full w-full h-full object-cover" src="https://mobilizon.fr/media/ff5b2d425fb73e17fcbb56a1a032359ee0b21453c11af59e103e783817a32fdf.png?name=framasoft%27s%20avatar.png" alt="" width="48" height="48"></figure>
|
||||
</div>
|
||||
<div class="" dir="auto"><a href="/@framasoft@mobilizon.fr" class="">
|
||||
<h2 class="mt-0">Framasoft</h2>
|
||||
<div class="flex flex-col items-start"><span class="text-sm">@framasoft@mobilizon.fr</span><span data-v-6955ca87="" class="rounded-md truncate text-sm text-black px-2 py-1 bg-mbz-info dark:text-black">Administrator</span></div>
|
||||
</a></div>
|
||||
</div>
|
||||
<div class="mt-3 prose dark:prose-invert lg:prose-xl prose-p:m-0 line-clamp-2">
|
||||
<p><strong>La Fediverse</strong>, <strong>c'est la <em><u>Féd</u>ération qui englobe l'Un<u>ivers</u> des réseaux sociaux libres et décentralisés,</em> </strong>dont Mobilizon (évènements), Mastodon (microblog), Peertube (vidéos), Pixelfed (photos), Funkwhale (musique), Matrix (messagerie instantanée)... et tant d'autres font partie.</p>
|
||||
<p><strong>Et "La Fediverse <em>Nantaise</em>" est un collectif cherchant à faire connaître localement tout le potentiel de ces réseaux ! :-)</strong></p>
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<div data-oruga="dropdown" class="o-drop o-drop--position-bottom-left">
|
||||
<div tabindex="0" class="o-drop__trigger" aria-haspopup="true"><span class="cursor-pointer material-design-icon dots-horizontal-icon cursor-pointer" aria-hidden="true" role="img"><svg fill="currentColor" class="material-design-icon__svg" width="24" height="24" viewBox="0 0 24 24"><path d="M16,12A2,2 0 0,1 18,10A2,2 0 0,1 20,12A2,2 0 0,1 18,14A2,2 0 0,1 16,12M10,12A2,2 0 0,1 12,10A2,2 0 0,1 14,12A2,2 0 0,1 12,14A2,2 0 0,1 10,12M4,12A2,2 0 0,1 6,10A2,2 0 0,1 8,12A2,2 0 0,1 6,14A2,2 0 0,1 4,12Z"><!--v-if--></path></svg></span></div>
|
||||
<!--teleport start-->
|
||||
<transition-stub name="fade" appear="false" persisted="false" css="true">
|
||||
<!---->
|
||||
</transition-stub>
|
||||
<transition-stub name="fade" appear="false" persisted="false" css="true">
|
||||
<div class="o-drop__menu o-drop__menu--bottom-left" role="list" aria-hidden="true" aria-modal="true" style="display: none;">
|
||||
<div class="o-drop__item o-drop__item--clickable inline-flex gap-1" role="listitem" tabindex="0" data-oruga="dropdown-item"><span aria-hidden="true" class="material-design-icon exit-to-app-icon" role="img"><svg fill="currentColor" class="material-design-icon__svg" width="24" height="24" viewBox="0 0 24 24"><path d="M19,3H5C3.89,3 3,3.89 3,5V9H5V5H19V19H5V15H3V19A2,2 0 0,0 5,21H19A2,2 0 0,0 21,19V5C21,3.89 20.1,3 19,3M10.08,15.58L11.5,17L16.5,12L11.5,7L10.08,8.41L12.67,11H3V13H12.67L10.08,15.58Z"><!--v-if--></path></svg></span> Leave</div>
|
||||
</div>
|
||||
</transition-stub>
|
||||
<!--teleport end-->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>"
|
||||
`;
|
||||
|
||||
exports[`GroupMemberCard > Show moderator 1`] = `
|
||||
"<div class="rounded shadow-lg bg-white dark:bg-mbz-purple dark:text-white">
|
||||
<div class="bg-mbz-yellow-alt-50 text-black flex items-center gap-1 p-2 rounded-t-lg" dir="auto">
|
||||
<figure class=""><img class="rounded-xl" src="https://social.tcit.fr/system/accounts/avatars/000/000/001/original/a28c50ce5f2b13fd.jpg" alt="" width="24" height="24"></figure> Thomas Citharel (@tcit)
|
||||
</div>
|
||||
<div class="flex items-center gap-2 p-2 pr-4" dir="auto">
|
||||
<div class="flex-1">
|
||||
<div class="p-2 flex gap-2">
|
||||
<div class="">
|
||||
<figure class="h-12 w-12"><img class="rounded-full w-full h-full object-cover" src="https://mobilizon.fr/media/ff5b2d425fb73e17fcbb56a1a032359ee0b21453c11af59e103e783817a32fdf.png?name=framasoft%27s%20avatar.png" alt="" width="48" height="48"></figure>
|
||||
</div>
|
||||
<div class="" dir="auto"><a href="/@framasoft@mobilizon.fr" class="">
|
||||
<h2 class="mt-0">Framasoft</h2>
|
||||
<div class="flex flex-col items-start"><span class="text-sm">@framasoft@mobilizon.fr</span><span data-v-6955ca87="" class="rounded-md truncate text-sm text-black px-2 py-1 bg-mbz-info dark:text-black">Moderator</span></div>
|
||||
</a></div>
|
||||
</div>
|
||||
<div class="mt-3 prose dark:prose-invert lg:prose-xl prose-p:m-0 line-clamp-2">
|
||||
<p><strong>La Fediverse</strong>, <strong>c'est la <em><u>Féd</u>ération qui englobe l'Un<u>ivers</u> des réseaux sociaux libres et décentralisés,</em> </strong>dont Mobilizon (évènements), Mastodon (microblog), Peertube (vidéos), Pixelfed (photos), Funkwhale (musique), Matrix (messagerie instantanée)... et tant d'autres font partie.</p>
|
||||
<p><strong>Et "La Fediverse <em>Nantaise</em>" est un collectif cherchant à faire connaître localement tout le potentiel de ces réseaux ! :-)</strong></p>
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<div data-oruga="dropdown" class="o-drop o-drop--position-bottom-left">
|
||||
<div tabindex="0" class="o-drop__trigger" aria-haspopup="true"><span class="cursor-pointer material-design-icon dots-horizontal-icon cursor-pointer" aria-hidden="true" role="img"><svg fill="currentColor" class="material-design-icon__svg" width="24" height="24" viewBox="0 0 24 24"><path d="M16,12A2,2 0 0,1 18,10A2,2 0 0,1 20,12A2,2 0 0,1 18,14A2,2 0 0,1 16,12M10,12A2,2 0 0,1 12,10A2,2 0 0,1 14,12A2,2 0 0,1 12,14A2,2 0 0,1 10,12M4,12A2,2 0 0,1 6,10A2,2 0 0,1 8,12A2,2 0 0,1 6,14A2,2 0 0,1 4,12Z"><!--v-if--></path></svg></span></div>
|
||||
<!--teleport start-->
|
||||
<transition-stub name="fade" appear="false" persisted="false" css="true">
|
||||
<!---->
|
||||
</transition-stub>
|
||||
<transition-stub name="fade" appear="false" persisted="false" css="true">
|
||||
<div class="o-drop__menu o-drop__menu--bottom-left" role="list" aria-hidden="true" aria-modal="true" style="display: none;">
|
||||
<div class="o-drop__item o-drop__item--clickable inline-flex gap-1" role="listitem" tabindex="0" data-oruga="dropdown-item"><span aria-hidden="true" class="material-design-icon exit-to-app-icon" role="img"><svg fill="currentColor" class="material-design-icon__svg" width="24" height="24" viewBox="0 0 24 24"><path d="M19,3H5C3.89,3 3,3.89 3,5V9H5V5H19V19H5V15H3V19A2,2 0 0,0 5,21H19A2,2 0 0,0 21,19V5C21,3.89 20.1,3 19,3M10.08,15.58L11.5,17L16.5,12L11.5,7L10.08,8.41L12.67,11H3V13H12.67L10.08,15.58Z"><!--v-if--></path></svg></span> Leave</div>
|
||||
</div>
|
||||
</transition-stub>
|
||||
<!--teleport end-->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>"
|
||||
`;
|
||||
|
||||
exports[`GroupMemberCard > Show simple member 1`] = `
|
||||
"<div class="rounded shadow-lg bg-white dark:bg-mbz-purple dark:text-white">
|
||||
<div class="bg-mbz-yellow-alt-50 text-black flex items-center gap-1 p-2 rounded-t-lg" dir="auto">
|
||||
<figure class=""><img class="rounded-xl" src="https://social.tcit.fr/system/accounts/avatars/000/000/001/original/a28c50ce5f2b13fd.jpg" alt="" width="24" height="24"></figure> Thomas Citharel (@tcit)
|
||||
</div>
|
||||
<div class="flex items-center gap-2 p-2 pr-4" dir="auto">
|
||||
<div class="flex-1">
|
||||
<div class="p-2 flex gap-2">
|
||||
<div class="">
|
||||
<figure class="h-12 w-12"><img class="rounded-full w-full h-full object-cover" src="https://mobilizon.fr/media/ff5b2d425fb73e17fcbb56a1a032359ee0b21453c11af59e103e783817a32fdf.png?name=framasoft%27s%20avatar.png" alt="" width="48" height="48"></figure>
|
||||
</div>
|
||||
<div class="" dir="auto"><a href="/@framasoft@mobilizon.fr" class="">
|
||||
<h2 class="mt-0">Framasoft</h2>
|
||||
<div class="flex flex-col items-start"><span class="text-sm">@framasoft@mobilizon.fr</span>
|
||||
<!--v-if-->
|
||||
</div>
|
||||
</a></div>
|
||||
</div>
|
||||
<div class="mt-3 prose dark:prose-invert lg:prose-xl prose-p:m-0 line-clamp-2">
|
||||
<p><strong>La Fediverse</strong>, <strong>c'est la <em><u>Féd</u>ération qui englobe l'Un<u>ivers</u> des réseaux sociaux libres et décentralisés,</em> </strong>dont Mobilizon (évènements), Mastodon (microblog), Peertube (vidéos), Pixelfed (photos), Funkwhale (musique), Matrix (messagerie instantanée)... et tant d'autres font partie.</p>
|
||||
<p><strong>Et "La Fediverse <em>Nantaise</em>" est un collectif cherchant à faire connaître localement tout le potentiel de ces réseaux ! :-)</strong></p>
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<div data-oruga="dropdown" class="o-drop o-drop--position-bottom-left">
|
||||
<div tabindex="0" class="o-drop__trigger" aria-haspopup="true"><span class="cursor-pointer material-design-icon dots-horizontal-icon cursor-pointer" aria-hidden="true" role="img"><svg fill="currentColor" class="material-design-icon__svg" width="24" height="24" viewBox="0 0 24 24"><path d="M16,12A2,2 0 0,1 18,10A2,2 0 0,1 20,12A2,2 0 0,1 18,14A2,2 0 0,1 16,12M10,12A2,2 0 0,1 12,10A2,2 0 0,1 14,12A2,2 0 0,1 12,14A2,2 0 0,1 10,12M4,12A2,2 0 0,1 6,10A2,2 0 0,1 8,12A2,2 0 0,1 6,14A2,2 0 0,1 4,12Z"><!--v-if--></path></svg></span></div>
|
||||
<!--teleport start-->
|
||||
<transition-stub name="fade" appear="false" persisted="false" css="true">
|
||||
<!---->
|
||||
</transition-stub>
|
||||
<transition-stub name="fade" appear="false" persisted="false" css="true">
|
||||
<div class="o-drop__menu o-drop__menu--bottom-left" role="list" aria-hidden="true" aria-modal="true" style="display: none;">
|
||||
<div class="o-drop__item o-drop__item--clickable inline-flex gap-1" role="listitem" tabindex="0" data-oruga="dropdown-item"><span aria-hidden="true" class="material-design-icon exit-to-app-icon" role="img"><svg fill="currentColor" class="material-design-icon__svg" width="24" height="24" viewBox="0 0 24 24"><path d="M19,3H5C3.89,3 3,3.89 3,5V9H5V5H19V19H5V15H3V19A2,2 0 0,0 5,21H19A2,2 0 0,0 21,19V5C21,3.89 20.1,3 19,3M10.08,15.58L11.5,17L16.5,12L11.5,7L10.08,8.41L12.67,11H3V13H12.67L10.08,15.58Z"><!--v-if--></path></svg></span> Leave</div>
|
||||
</div>
|
||||
</transition-stub>
|
||||
<!--teleport end-->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>"
|
||||
`;
|
||||
@@ -1,11 +0,0 @@
|
||||
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
|
||||
|
||||
exports[`GroupMembers > Show simple 1`] = `
|
||||
"<div>
|
||||
<!--v-if-->
|
||||
<transition-stub name="fade" appear="false" persisted="false" css="true">
|
||||
<!---->
|
||||
</transition-stub>
|
||||
<!--v-if-->
|
||||
</div>"
|
||||
`;
|
||||
@@ -1,19 +0,0 @@
|
||||
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
|
||||
|
||||
exports[`GroupSettings > Show simple 1`] = `
|
||||
"<div>
|
||||
<!--v-if-->
|
||||
<transition-stub name="fade" appear="false" persisted="false" css="true">
|
||||
<!---->
|
||||
</transition-stub>
|
||||
<transition-stub name="fade" appear="false" persisted="false" css="true">
|
||||
<article class="o-notification o-notification--top" data-oruga="notification">
|
||||
<!---->
|
||||
<div class="o-notification__wrapper">
|
||||
<!---->
|
||||
<div class="o-notification__content">You are not an administrator for this group.</div>
|
||||
</div>
|
||||
</article>
|
||||
</transition-stub>
|
||||
</div>"
|
||||
`;
|
||||
@@ -1,25 +0,0 @@
|
||||
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
|
||||
|
||||
exports[`GroupView > Show simple 1`] = `
|
||||
"<div data-v-63850a71="" class="container mx-auto is-widescreen">
|
||||
<!--v-if-->
|
||||
<transition-stub data-v-63850a71="" name="fade" appear="false" persisted="false" css="true">
|
||||
<article class="o-notification o-notification--danger o-notification--top" data-oruga="notification">
|
||||
<!---->
|
||||
<div class="o-notification__wrapper">
|
||||
<!---->
|
||||
<div class="o-notification__content">No group found</div>
|
||||
</div>
|
||||
</article>
|
||||
</transition-stub>
|
||||
<!--v-if-->
|
||||
<!--v-if-->
|
||||
<!--v-if-->
|
||||
<div data-v-63850a71="" class="my-2">
|
||||
<!--v-if-->
|
||||
</div>
|
||||
<!--v-if-->
|
||||
<!--v-if-->
|
||||
<!--v-if-->
|
||||
</div>"
|
||||
`;
|
||||
@@ -1,25 +0,0 @@
|
||||
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
|
||||
|
||||
exports[`MyGroups > Show simple 1`] = `
|
||||
"<section data-v-59f508e2="" class="container mx-auto px-1 mb-6">
|
||||
<h1 data-v-59f508e2="" class="title">My groups</h1>
|
||||
<p data-v-59f508e2="">Groups are spaces for coordination and preparation to better organize events and manage your community.</p>
|
||||
<div data-v-59f508e2="" class="flex my-3"><a data-v-59f508e2="" href="/groups/create" class="o-btn o-btn--primary" role="button" data-oruga="button"><span class="o-btn__wrapper"><!----><span class="o-btn__label">Create group</span>
|
||||
<!----></span>
|
||||
</a></div>
|
||||
<transition-stub data-v-59f508e2="" name="fade" appear="false" persisted="false" css="true">
|
||||
<!---->
|
||||
</transition-stub>
|
||||
<!--v-if-->
|
||||
<!--v-if-->
|
||||
<section data-v-59f508e2="" class="text-center not-found">
|
||||
<div data-v-59f508e2="" class="">
|
||||
<div data-v-59f508e2="" class="">
|
||||
<div data-v-59f508e2="" class="text-center prose dark:prose-invert max-w-full">
|
||||
<p data-v-59f508e2="">You are not part of any group. Do you wish to <a data-v-59f508e2="" href="/groups/create" class="">create a group</a> or <a data-v-59f508e2="" href="/search?contentType=GROUPS" class="">explore the groups</a>?</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</section>"
|
||||
`;
|
||||
@@ -1,17 +0,0 @@
|
||||
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
|
||||
|
||||
exports[`SettingsView > Show simple 1`] = `
|
||||
"<div class="container mx-auto" preferredusername="my-group">
|
||||
<h1 class="">Settings</h1>
|
||||
<div class="flex flex-wrap gap-2">
|
||||
<aside class="sm:max-w-xs flex-1 min-w-[320px]">
|
||||
<ul>
|
||||
<setting-menu-section-stub title="Settings" to="[object Object]"></setting-menu-section-stub>
|
||||
</ul>
|
||||
</aside>
|
||||
<div class="flex-1">
|
||||
<router-view-stub name="default"></router-view-stub>
|
||||
</div>
|
||||
</div>
|
||||
</div>"
|
||||
`;
|
||||
@@ -1,203 +0,0 @@
|
||||
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
|
||||
|
||||
exports[`TimelineView > Show simple 1`] = `
|
||||
"<div data-v-4ef926d4="" class="container mx-auto section">
|
||||
<!--v-if-->
|
||||
<section data-v-4ef926d4="" class="timeline">
|
||||
<div data-v-4ef926d4="" data-oruga="field" class="o-field">
|
||||
<!---->
|
||||
<div class="o-field__body">
|
||||
<div class="o-field o-field--addons"><label data-v-4ef926d4="" class="o-radio o-radio--checked" data-oruga="radio" role="radio" aria-checked="true"><input class="pr-4 o-radio__input o-radio__input--checked" type="radio" data-oruga-input="radio" autocomplete="off"><span class="o-radio__label"><span data-v-4ef926d4="" aria-hidden="true" class="material-design-icon timeline-text-icon" role="img"><svg fill="currentColor" class="material-design-icon__svg" width="24" height="24" viewBox="0 0 24 24"><path d="M4 2V8H2V2H4M2 22H4V16H2V22M5 12C5 10.9 4.11 10 3 10C1.9 10 1 10.9 1 12C1 13.11 1.9 14 3 14C4.11 14 5 13.11 5 12M24 6V18C24 19.11 23.11 20 22 20H10C8.9 20 8 19.11 8 18V14L6 12L8 10V6C8 4.89 8.9 4 10 4H22C23.11 4 24 4.89 24 6M19 13H11V15H19V13M21 9H11V11H21V9Z"><!--v-if--></path></svg></span> All activities</span></label><label data-v-4ef926d4="" class="o-radio" data-oruga="radio" role="radio" aria-checked="false"><input class="pr-4 o-radio__input" type="radio" data-oruga-input="radio" autocomplete="off" value="MEMBER"><span class="o-radio__label"><span data-v-4ef926d4="" class="o-icon" data-oruga="icon"><i class="mdi mdi-account-multiple-plus mdi-24px"></i></span> Members</span></label><label data-v-4ef926d4="" class="o-radio" data-oruga="radio" role="radio" aria-checked="false"><input class="pr-4 o-radio__input" type="radio" data-oruga-input="radio" autocomplete="off" value="GROUP"><span class="o-radio__label"><span data-v-4ef926d4="" class="o-icon" data-oruga="icon"><i class="mdi mdi-cog mdi-24px"></i></span> Settings</span></label><label data-v-4ef926d4="" class="o-radio" data-oruga="radio" role="radio" aria-checked="false"><input class="pr-4 o-radio__input" type="radio" data-oruga-input="radio" autocomplete="off" value="EVENT"><span class="o-radio__label"><span data-v-4ef926d4="" class="o-icon" data-oruga="icon"><i class="mdi mdi-calendar mdi-24px"></i></span> Events</span></label><label data-v-4ef926d4="" class="o-radio" data-oruga="radio" role="radio" aria-checked="false"><input class="pr-4 o-radio__input" type="radio" data-oruga-input="radio" autocomplete="off" value="POST"><span class="o-radio__label"><span data-v-4ef926d4="" class="o-icon" data-oruga="icon"><i class="mdi mdi-bullhorn mdi-24px"></i></span> Posts</span></label><label data-v-4ef926d4="" class="o-radio" data-oruga="radio" role="radio" aria-checked="false"><input class="pr-4 o-radio__input" type="radio" data-oruga-input="radio" autocomplete="off" value="DISCUSSION"><span class="o-radio__label"><span data-v-4ef926d4="" class="o-icon" data-oruga="icon"><i class="mdi mdi-chat mdi-24px"></i></span> Discussions</span></label><label data-v-4ef926d4="" class="o-radio" data-oruga="radio" role="radio" aria-checked="false"><input type="radio" data-oruga-input="radio" class="o-radio__input" autocomplete="off" value="RESOURCE"><span class="o-radio__label"><span data-v-4ef926d4="" class="o-icon" data-oruga="icon"><i class="mdi mdi-link mdi-24px"></i></span> Resources</span></label></div>
|
||||
</div>
|
||||
<!---->
|
||||
</div>
|
||||
<div data-v-4ef926d4="" data-oruga="field" class="o-field">
|
||||
<!---->
|
||||
<div class="o-field__body">
|
||||
<div class="o-field o-field--addons"><label data-v-4ef926d4="" class="o-radio o-radio--checked" data-oruga="radio" role="radio" aria-checked="true"><input class="pr-4 o-radio__input o-radio__input--checked" type="radio" data-oruga-input="radio" autocomplete="off"><span class="o-radio__label"><span data-v-4ef926d4="" aria-hidden="true" class="material-design-icon timeline-text-icon" role="img"><svg fill="currentColor" class="material-design-icon__svg" width="24" height="24" viewBox="0 0 24 24"><path d="M4 2V8H2V2H4M2 22H4V16H2V22M5 12C5 10.9 4.11 10 3 10C1.9 10 1 10.9 1 12C1 13.11 1.9 14 3 14C4.11 14 5 13.11 5 12M24 6V18C24 19.11 23.11 20 22 20H10C8.9 20 8 19.11 8 18V14L6 12L8 10V6C8 4.89 8.9 4 10 4H22C23.11 4 24 4.89 24 6M19 13H11V15H19V13M21 9H11V11H21V9Z"><!--v-if--></path></svg></span> All activities</span></label><label data-v-4ef926d4="" class="o-radio" data-oruga="radio" role="radio" aria-checked="false"><input class="pr-4 o-radio__input" type="radio" data-oruga-input="radio" autocomplete="off" value="SELF"><span class="o-radio__label"><span data-v-4ef926d4="" class="o-icon" data-oruga="icon"><i class="mdi mdi-account mdi-24px"></i></span> From yourself</span></label><label data-v-4ef926d4="" class="o-radio" data-oruga="radio" role="radio" aria-checked="false"><input class="pr-4 o-radio__input" type="radio" data-oruga-input="radio" autocomplete="off" value="BY"><span class="o-radio__label"><span data-v-4ef926d4="" class="o-icon" data-oruga="icon"><i class="mdi mdi-account-multiple mdi-24px"></i></span> By others</span></label></div>
|
||||
</div>
|
||||
<!---->
|
||||
</div>
|
||||
<transition-group-stub data-v-4ef926d4="" name="timeline-list" tag="div" appear="false" persisted="false" css="true">
|
||||
<div data-v-4ef926d4="" class="day">
|
||||
<div data-v-4ef926d4="" data-oruga="skeleton" class="o-sklt o-sklt--left">
|
||||
<div class="o-sklt__item o-sklt__item--rounded o-sklt__item--animated" style="height: 48px; width: 300px;"></div>
|
||||
</div>
|
||||
<ul data-v-4ef926d4="" class="before:opacity-10">
|
||||
<li data-v-4ef926d4="">
|
||||
<div data-v-56a583cf="" data-v-4ef926d4="" class="activity-item"><span data-v-56a583cf=""><div data-v-56a583cf="" data-oruga="skeleton" class="o-sklt o-sklt--left"><div class="o-sklt__item o-sklt__item--rounded o-sklt__item--animated" style="height: 32px; width: 32px; border-radius: 50%;"></div></div></span>
|
||||
<div data-v-56a583cf="" class="subject">
|
||||
<div data-v-56a583cf="" class="prose dark:prose-invert">
|
||||
<p data-v-56a583cf="">
|
||||
<div data-v-56a583cf="" data-oruga="skeleton" class="o-sklt o-sklt--left">
|
||||
<div class="o-sklt__item o-sklt__item--rounded o-sklt__item--animated"></div>
|
||||
</div>
|
||||
<div data-v-56a583cf="" data-oruga="skeleton" class="o-sklt o-sklt--left datetime">
|
||||
<div class="o-sklt__item o-sklt__item--rounded o-sklt__item--animated"></div>
|
||||
</div>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
<li data-v-4ef926d4="">
|
||||
<div data-v-56a583cf="" data-v-4ef926d4="" class="activity-item"><span data-v-56a583cf=""><div data-v-56a583cf="" data-oruga="skeleton" class="o-sklt o-sklt--left"><div class="o-sklt__item o-sklt__item--rounded o-sklt__item--animated" style="height: 32px; width: 32px; border-radius: 50%;"></div></div></span>
|
||||
<div data-v-56a583cf="" class="subject">
|
||||
<div data-v-56a583cf="" class="prose dark:prose-invert">
|
||||
<p data-v-56a583cf="">
|
||||
<div data-v-56a583cf="" data-oruga="skeleton" class="o-sklt o-sklt--left">
|
||||
<div class="o-sklt__item o-sklt__item--rounded o-sklt__item--animated"></div>
|
||||
</div>
|
||||
<div data-v-56a583cf="" data-oruga="skeleton" class="o-sklt o-sklt--left datetime">
|
||||
<div class="o-sklt__item o-sklt__item--rounded o-sklt__item--animated"></div>
|
||||
</div>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
<li data-v-4ef926d4="">
|
||||
<div data-v-56a583cf="" data-v-4ef926d4="" class="activity-item"><span data-v-56a583cf=""><div data-v-56a583cf="" data-oruga="skeleton" class="o-sklt o-sklt--left"><div class="o-sklt__item o-sklt__item--rounded o-sklt__item--animated" style="height: 32px; width: 32px; border-radius: 50%;"></div></div></span>
|
||||
<div data-v-56a583cf="" class="subject">
|
||||
<div data-v-56a583cf="" class="prose dark:prose-invert">
|
||||
<p data-v-56a583cf="">
|
||||
<div data-v-56a583cf="" data-oruga="skeleton" class="o-sklt o-sklt--left">
|
||||
<div class="o-sklt__item o-sklt__item--rounded o-sklt__item--animated"></div>
|
||||
</div>
|
||||
<div data-v-56a583cf="" data-oruga="skeleton" class="o-sklt o-sklt--left datetime">
|
||||
<div class="o-sklt__item o-sklt__item--rounded o-sklt__item--animated"></div>
|
||||
</div>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
<li data-v-4ef926d4="">
|
||||
<div data-v-56a583cf="" data-v-4ef926d4="" class="activity-item"><span data-v-56a583cf=""><div data-v-56a583cf="" data-oruga="skeleton" class="o-sklt o-sklt--left"><div class="o-sklt__item o-sklt__item--rounded o-sklt__item--animated" style="height: 32px; width: 32px; border-radius: 50%;"></div></div></span>
|
||||
<div data-v-56a583cf="" class="subject">
|
||||
<div data-v-56a583cf="" class="prose dark:prose-invert">
|
||||
<p data-v-56a583cf="">
|
||||
<div data-v-56a583cf="" data-oruga="skeleton" class="o-sklt o-sklt--left">
|
||||
<div class="o-sklt__item o-sklt__item--rounded o-sklt__item--animated"></div>
|
||||
</div>
|
||||
<div data-v-56a583cf="" data-oruga="skeleton" class="o-sklt o-sklt--left datetime">
|
||||
<div class="o-sklt__item o-sklt__item--rounded o-sklt__item--animated"></div>
|
||||
</div>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
<li data-v-4ef926d4="">
|
||||
<div data-v-56a583cf="" data-v-4ef926d4="" class="activity-item"><span data-v-56a583cf=""><div data-v-56a583cf="" data-oruga="skeleton" class="o-sklt o-sklt--left"><div class="o-sklt__item o-sklt__item--rounded o-sklt__item--animated" style="height: 32px; width: 32px; border-radius: 50%;"></div></div></span>
|
||||
<div data-v-56a583cf="" class="subject">
|
||||
<div data-v-56a583cf="" class="prose dark:prose-invert">
|
||||
<p data-v-56a583cf="">
|
||||
<div data-v-56a583cf="" data-oruga="skeleton" class="o-sklt o-sklt--left">
|
||||
<div class="o-sklt__item o-sklt__item--rounded o-sklt__item--animated"></div>
|
||||
</div>
|
||||
<div data-v-56a583cf="" data-oruga="skeleton" class="o-sklt o-sklt--left datetime">
|
||||
<div class="o-sklt__item o-sklt__item--rounded o-sklt__item--animated"></div>
|
||||
</div>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div data-v-4ef926d4="" class="day">
|
||||
<div data-v-4ef926d4="" data-oruga="skeleton" class="o-sklt o-sklt--left">
|
||||
<div class="o-sklt__item o-sklt__item--rounded o-sklt__item--animated" style="height: 48px; width: 300px;"></div>
|
||||
</div>
|
||||
<ul data-v-4ef926d4="" class="before:opacity-10">
|
||||
<li data-v-4ef926d4="">
|
||||
<div data-v-56a583cf="" data-v-4ef926d4="" class="activity-item"><span data-v-56a583cf=""><div data-v-56a583cf="" data-oruga="skeleton" class="o-sklt o-sklt--left"><div class="o-sklt__item o-sklt__item--rounded o-sklt__item--animated" style="height: 32px; width: 32px; border-radius: 50%;"></div></div></span>
|
||||
<div data-v-56a583cf="" class="subject">
|
||||
<div data-v-56a583cf="" class="prose dark:prose-invert">
|
||||
<p data-v-56a583cf="">
|
||||
<div data-v-56a583cf="" data-oruga="skeleton" class="o-sklt o-sklt--left">
|
||||
<div class="o-sklt__item o-sklt__item--rounded o-sklt__item--animated"></div>
|
||||
</div>
|
||||
<div data-v-56a583cf="" data-oruga="skeleton" class="o-sklt o-sklt--left datetime">
|
||||
<div class="o-sklt__item o-sklt__item--rounded o-sklt__item--animated"></div>
|
||||
</div>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
<li data-v-4ef926d4="">
|
||||
<div data-v-56a583cf="" data-v-4ef926d4="" class="activity-item"><span data-v-56a583cf=""><div data-v-56a583cf="" data-oruga="skeleton" class="o-sklt o-sklt--left"><div class="o-sklt__item o-sklt__item--rounded o-sklt__item--animated" style="height: 32px; width: 32px; border-radius: 50%;"></div></div></span>
|
||||
<div data-v-56a583cf="" class="subject">
|
||||
<div data-v-56a583cf="" class="prose dark:prose-invert">
|
||||
<p data-v-56a583cf="">
|
||||
<div data-v-56a583cf="" data-oruga="skeleton" class="o-sklt o-sklt--left">
|
||||
<div class="o-sklt__item o-sklt__item--rounded o-sklt__item--animated"></div>
|
||||
</div>
|
||||
<div data-v-56a583cf="" data-oruga="skeleton" class="o-sklt o-sklt--left datetime">
|
||||
<div class="o-sklt__item o-sklt__item--rounded o-sklt__item--animated"></div>
|
||||
</div>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
<li data-v-4ef926d4="">
|
||||
<div data-v-56a583cf="" data-v-4ef926d4="" class="activity-item"><span data-v-56a583cf=""><div data-v-56a583cf="" data-oruga="skeleton" class="o-sklt o-sklt--left"><div class="o-sklt__item o-sklt__item--rounded o-sklt__item--animated" style="height: 32px; width: 32px; border-radius: 50%;"></div></div></span>
|
||||
<div data-v-56a583cf="" class="subject">
|
||||
<div data-v-56a583cf="" class="prose dark:prose-invert">
|
||||
<p data-v-56a583cf="">
|
||||
<div data-v-56a583cf="" data-oruga="skeleton" class="o-sklt o-sklt--left">
|
||||
<div class="o-sklt__item o-sklt__item--rounded o-sklt__item--animated"></div>
|
||||
</div>
|
||||
<div data-v-56a583cf="" data-oruga="skeleton" class="o-sklt o-sklt--left datetime">
|
||||
<div class="o-sklt__item o-sklt__item--rounded o-sklt__item--animated"></div>
|
||||
</div>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
<li data-v-4ef926d4="">
|
||||
<div data-v-56a583cf="" data-v-4ef926d4="" class="activity-item"><span data-v-56a583cf=""><div data-v-56a583cf="" data-oruga="skeleton" class="o-sklt o-sklt--left"><div class="o-sklt__item o-sklt__item--rounded o-sklt__item--animated" style="height: 32px; width: 32px; border-radius: 50%;"></div></div></span>
|
||||
<div data-v-56a583cf="" class="subject">
|
||||
<div data-v-56a583cf="" class="prose dark:prose-invert">
|
||||
<p data-v-56a583cf="">
|
||||
<div data-v-56a583cf="" data-oruga="skeleton" class="o-sklt o-sklt--left">
|
||||
<div class="o-sklt__item o-sklt__item--rounded o-sklt__item--animated"></div>
|
||||
</div>
|
||||
<div data-v-56a583cf="" data-oruga="skeleton" class="o-sklt o-sklt--left datetime">
|
||||
<div class="o-sklt__item o-sklt__item--rounded o-sklt__item--animated"></div>
|
||||
</div>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
<li data-v-4ef926d4="">
|
||||
<div data-v-56a583cf="" data-v-4ef926d4="" class="activity-item"><span data-v-56a583cf=""><div data-v-56a583cf="" data-oruga="skeleton" class="o-sklt o-sklt--left"><div class="o-sklt__item o-sklt__item--rounded o-sklt__item--animated" style="height: 32px; width: 32px; border-radius: 50%;"></div></div></span>
|
||||
<div data-v-56a583cf="" class="subject">
|
||||
<div data-v-56a583cf="" class="prose dark:prose-invert">
|
||||
<p data-v-56a583cf="">
|
||||
<div data-v-56a583cf="" data-oruga="skeleton" class="o-sklt o-sklt--left">
|
||||
<div class="o-sklt__item o-sklt__item--rounded o-sklt__item--animated"></div>
|
||||
</div>
|
||||
<div data-v-56a583cf="" data-oruga="skeleton" class="o-sklt o-sklt--left datetime">
|
||||
<div class="o-sklt__item o-sklt__item--rounded o-sklt__item--animated"></div>
|
||||
</div>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</transition-group-stub>
|
||||
<!---->
|
||||
<!---->
|
||||
<div data-v-4ef926d4="" class="observer"></div>
|
||||
<!--v-if-->
|
||||
</section>
|
||||
</div>"
|
||||
`;
|
||||
@@ -7,9 +7,8 @@ import { Oruga } from "@oruga-ui/oruga-next";
|
||||
import flushPromises from "flush-promises";
|
||||
import { getMockClient, requestHandlers } from "../../mocks/client";
|
||||
import { htmlRemoveId } from "../../common";
|
||||
import MyGroups from "@/views/Group/MyGroups.vue";
|
||||
import { LOGGED_USER_MEMBERSHIPS } from "@/graphql/actor";
|
||||
import { LEAVE_GROUP } from "@/graphql/group";
|
||||
import CategoriesPreview from "@/components/Home/CategoriesPreview.vue";
|
||||
import { CATEGORY_STATISTICS } from "@/graphql/statistics";
|
||||
|
||||
config.global.plugins.push(Oruga);
|
||||
|
||||
@@ -25,10 +24,10 @@ beforeEach(async () => {
|
||||
});
|
||||
|
||||
const generateWrapper = () => {
|
||||
const global_data = getMockClient([LOGGED_USER_MEMBERSHIPS, LEAVE_GROUP]);
|
||||
const global_data = getMockClient([CATEGORY_STATISTICS]);
|
||||
global_data.provide.dateFnsLocale = enUS;
|
||||
global_data.plugins = [router];
|
||||
return mount(MyGroups, {
|
||||
return mount(CategoriesPreview, {
|
||||
props: {},
|
||||
global: {
|
||||
...global_data,
|
||||
@@ -39,13 +38,13 @@ const generateWrapper = () => {
|
||||
});
|
||||
};
|
||||
|
||||
describe("MyGroups", () => {
|
||||
describe("CategoriesPreview", () => {
|
||||
it("Show simple", async () => {
|
||||
const wrapper = generateWrapper();
|
||||
await wrapper.vm.$nextTick();
|
||||
await flushPromises();
|
||||
expect(htmlRemoveId(wrapper.html())).toMatchSnapshot();
|
||||
expect(requestHandlers.handle_0).toHaveBeenCalledTimes(1);
|
||||
expect(requestHandlers.handle_1).toHaveBeenCalledTimes(0);
|
||||
expect(requestHandlers.handle_0).toHaveBeenCalledWith({});
|
||||
});
|
||||
});
|
||||
@@ -5,10 +5,9 @@ import { createRouter, createWebHistory, Router } from "vue-router";
|
||||
import { config, mount } from "@vue/test-utils";
|
||||
import { Oruga } from "@oruga-ui/oruga-next";
|
||||
import flushPromises from "flush-promises";
|
||||
import { getMockClient, requestHandlers } from "../../mocks/client";
|
||||
import { getMockClient } from "../../mocks/client";
|
||||
import { htmlRemoveId } from "../../common";
|
||||
import CreateView from "@/views/Group/CreateView.vue";
|
||||
import { CREATE_GROUP } from "@/graphql/group";
|
||||
import MobilizonPresentation from "@/components/Home/MobilizonPresentation.vue";
|
||||
|
||||
config.global.plugins.push(Oruga);
|
||||
|
||||
@@ -24,10 +23,10 @@ beforeEach(async () => {
|
||||
});
|
||||
|
||||
const generateWrapper = () => {
|
||||
const global_data = getMockClient([CREATE_GROUP]);
|
||||
const global_data = getMockClient([]);
|
||||
global_data.provide.dateFnsLocale = enUS;
|
||||
global_data.plugins = [router];
|
||||
return mount(CreateView, {
|
||||
return mount(MobilizonPresentation, {
|
||||
props: {},
|
||||
global: {
|
||||
...global_data,
|
||||
@@ -38,12 +37,11 @@ const generateWrapper = () => {
|
||||
});
|
||||
};
|
||||
|
||||
describe("CreateView", () => {
|
||||
describe("MobilizonPresentation", () => {
|
||||
it("Show simple", async () => {
|
||||
const wrapper = generateWrapper();
|
||||
await wrapper.vm.$nextTick();
|
||||
await flushPromises();
|
||||
expect(htmlRemoveId(wrapper.html())).toMatchSnapshot();
|
||||
expect(requestHandlers.handle_0).toHaveBeenCalledTimes(0);
|
||||
});
|
||||
});
|
||||
@@ -2,12 +2,12 @@ import { beforeEach, describe, it, expect } from "vitest";
|
||||
import { enUS } from "date-fns/locale";
|
||||
import { routes } from "@/router";
|
||||
import { createRouter, createWebHistory, Router } from "vue-router";
|
||||
import { config, shallowMount } from "@vue/test-utils";
|
||||
import { config, mount } from "@vue/test-utils";
|
||||
import { Oruga } from "@oruga-ui/oruga-next";
|
||||
import flushPromises from "flush-promises";
|
||||
import { getMockClient } from "../../mocks/client";
|
||||
import { htmlRemoveId } from "../../common";
|
||||
import SettingsView from "@/views/Group/SettingsView.vue";
|
||||
import SearchFields from "@/components/Home/SearchFields.vue";
|
||||
|
||||
config.global.plugins.push(Oruga);
|
||||
|
||||
@@ -26,9 +26,10 @@ const generateWrapper = () => {
|
||||
const global_data = getMockClient([]);
|
||||
global_data.provide.dateFnsLocale = enUS;
|
||||
global_data.plugins = [router];
|
||||
return shallowMount(SettingsView, {
|
||||
return mount(SearchFields, {
|
||||
props: {
|
||||
preferredUsername: "my-group",
|
||||
search: "",
|
||||
location: {},
|
||||
},
|
||||
global: {
|
||||
...global_data,
|
||||
@@ -39,7 +40,7 @@ const generateWrapper = () => {
|
||||
});
|
||||
};
|
||||
|
||||
describe("SettingsView", () => {
|
||||
describe("SearchFields", () => {
|
||||
it("Show simple", async () => {
|
||||
const wrapper = generateWrapper();
|
||||
await wrapper.vm.$nextTick();
|
||||
@@ -0,0 +1,68 @@
|
||||
import { beforeEach, describe, it, expect } from "vitest";
|
||||
import { enUS } from "date-fns/locale";
|
||||
import { routes } from "@/router";
|
||||
import { createRouter, createWebHistory, Router } from "vue-router";
|
||||
import { config, mount } from "@vue/test-utils";
|
||||
import { Oruga } from "@oruga-ui/oruga-next";
|
||||
import flushPromises from "flush-promises";
|
||||
import { getMockClient } from "../../mocks/client";
|
||||
import { htmlRemoveId } from "../../common";
|
||||
import UnloggedIntroduction from "@/components/Home/UnloggedIntroduction.vue";
|
||||
import { reactive } from "vue";
|
||||
|
||||
config.global.plugins.push(Oruga);
|
||||
|
||||
let router: Router;
|
||||
|
||||
beforeEach(async () => {
|
||||
router = createRouter({
|
||||
history: createWebHistory(),
|
||||
routes: routes,
|
||||
});
|
||||
|
||||
// await router.isReady();
|
||||
});
|
||||
|
||||
const generateWrapper = (props: any) => {
|
||||
const global_data = getMockClient([]);
|
||||
global_data.provide.dateFnsLocale = enUS;
|
||||
global_data.plugins = [router];
|
||||
return mount(UnloggedIntroduction, {
|
||||
props: props,
|
||||
global: {
|
||||
...global_data,
|
||||
stubs: {
|
||||
RouterLink: false,
|
||||
},
|
||||
},
|
||||
});
|
||||
};
|
||||
|
||||
const mockconfig = reactive({
|
||||
name: "My instance name",
|
||||
description: "An instance that doesn't exist",
|
||||
slogan: "Test! Test! Test!",
|
||||
registrationsOpen: true,
|
||||
});
|
||||
|
||||
const mockconfigClosed = reactive({ ...config, registrationsOpen: false });
|
||||
|
||||
describe("UnloggedIntroduction", () => {
|
||||
it("Show open", async () => {
|
||||
const wrapper = generateWrapper({
|
||||
config: mockconfig,
|
||||
});
|
||||
await wrapper.vm.$nextTick();
|
||||
await flushPromises();
|
||||
expect(htmlRemoveId(wrapper.html())).toMatchSnapshot();
|
||||
});
|
||||
|
||||
it("Show close", async () => {
|
||||
const wrapper = generateWrapper({
|
||||
config: mockconfigClosed,
|
||||
});
|
||||
await wrapper.vm.$nextTick();
|
||||
await flushPromises();
|
||||
expect(htmlRemoveId(wrapper.html())).toMatchSnapshot();
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,3 @@
|
||||
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
|
||||
|
||||
exports[`CategoriesPreview > Show simple 1`] = `"<!--v-if-->"`;
|
||||
@@ -0,0 +1,23 @@
|
||||
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
|
||||
|
||||
exports[`MobilizonPresentation > Show simple 1`] = `
|
||||
"<div class="container mx-auto py-4 px-2">
|
||||
<div class="grid grid-cols-1 md:grid-cols-3 gap-3">
|
||||
<div>
|
||||
<h3 class="dark:text-white text-3xl font-bold">A practical tool</h3>
|
||||
<p class="dark:text-white">Mobilizon is a tool that helps you <b>find, create and organise events</b>.</p>
|
||||
</div>
|
||||
<div>
|
||||
<h3 class="dark:text-white text-3xl font-bold">An ethical alternative</h3>
|
||||
<p class="dark:text-white">Ethical alternative to Facebook events, groups and pages, Mobilizon is a <b>tool designed to serve you</b>. Period.</p>
|
||||
</div>
|
||||
<div>
|
||||
<h3 class="dark:text-white text-3xl font-bold">A federated software</h3>
|
||||
<p class="dark:text-white">Mobilizon is not a giant platform, but a <b>multitude of interconnected Mobilizon websites</b>.</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="mt-4 text-center"><a class="o-btn o-btn--large o-btn--primary" role="button" data-oruga="button" href="https://mobilizon.org"><span class="o-btn__wrapper"><!----><span class="o-btn__label">Learn more about Mobilizon</span>
|
||||
<!----></span>
|
||||
</a></div>
|
||||
</div>"
|
||||
`;
|
||||
@@ -0,0 +1,21 @@
|
||||
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
|
||||
|
||||
exports[`SearchFields > Show simple 1`] = `
|
||||
"<form data-v-a19720a3="" id="search-anchor" class="container mx-auto p-2 flex flex-col flex-wrap items-stretch gap-2 justify-center dark:text-slate-100" role="search" location="[object Object]">
|
||||
<div data-v-a19720a3="" class="flex flex-col flex-wrap sm:flex-row gap-2 justify-center"><label data-v-a19720a3="" class="sr-only" for="search_field_input">Keyword, event title, group name, etc.</label>
|
||||
<div data-v-a19720a3="" data-oruga="input" class="o-input__wrapper o-input__wrapper--expanded"><input class="min-w-48 o-input" autofocus="" autocapitalize="off" autocorrect="off" id="search_field_input" data-oruga-input="text" type="text" maxlength="1024" autocomplete="off" placeholder="Keyword, event title, group name, etc.">
|
||||
<!---->
|
||||
<!---->
|
||||
<!---->
|
||||
</div>
|
||||
<!---->
|
||||
</div>
|
||||
<div data-v-a19720a3="" class="flex flex-col flex-wrap sm:flex-row gap-2 justify-center"><button data-v-a19720a3="" type="submit" class="o-btn search-Event min-w-40" role="button" data-oruga="button"><span class="o-btn__wrapper"><span class="o-icon o-btn__icon o-btn__icon-left" data-oruga="icon"><i class="mdi mdi-calendar mdi-24px"></i></span><span class="o-btn__label">Events</span>
|
||||
<!----></span>
|
||||
</button>
|
||||
<!--v-if--><button data-v-a19720a3="" type="submit" class="o-btn search-Group min-w-40" role="button" data-oruga="button"><span class="o-btn__wrapper"><span class="o-icon o-btn__icon o-btn__icon-left" data-oruga="icon"><i class="mdi mdi-account-multiple mdi-24px"></i></span><span class="o-btn__label">Groups</span>
|
||||
<!----></span>
|
||||
</button>
|
||||
</div>
|
||||
</form>"
|
||||
`;
|
||||
@@ -0,0 +1,15 @@
|
||||
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
|
||||
|
||||
exports[`UnloggedIntroduction > Show close 1`] = `
|
||||
"<section class="container mx-auto px-2 my-3">
|
||||
<h1 class="dark:text-white font-bold">Gather ⋅ Organize ⋅ Mobilize</h1>
|
||||
<p class="dark:text-white mb-2"></p>
|
||||
</section>"
|
||||
`;
|
||||
|
||||
exports[`UnloggedIntroduction > Show open 1`] = `
|
||||
"<section class="container mx-auto px-2 my-3">
|
||||
<h1 class="dark:text-white font-bold">Test! Test! Test!</h1>
|
||||
<p class="dark:text-white mb-2">An instance that doesn't exist</p>
|
||||
</section>"
|
||||
`;
|
||||
64
tests/unit/specs/components/Post/SharePostModal.spec.ts
Normal file
64
tests/unit/specs/components/Post/SharePostModal.spec.ts
Normal file
@@ -0,0 +1,64 @@
|
||||
import { beforeEach, describe, it, expect } from "vitest";
|
||||
import { enUS } from "date-fns/locale";
|
||||
import { routes } from "@/router";
|
||||
import { createRouter, createWebHistory, Router } from "vue-router";
|
||||
import { config, mount } from "@vue/test-utils";
|
||||
import { Oruga } from "@oruga-ui/oruga-next";
|
||||
import flushPromises from "flush-promises";
|
||||
import { getMockClient } from "../../mocks/client";
|
||||
import { htmlRemoveId } from "../../common";
|
||||
import SharePostModal from "@/components/Post/SharePostModal.vue";
|
||||
import { PostVisibility } from "@/types/enums";
|
||||
|
||||
config.global.plugins.push(Oruga);
|
||||
|
||||
let router: Router;
|
||||
|
||||
beforeEach(async () => {
|
||||
router = createRouter({
|
||||
history: createWebHistory(),
|
||||
routes: routes,
|
||||
});
|
||||
|
||||
// await router.isReady();
|
||||
});
|
||||
|
||||
const generateWrapper = (props: any = {}) => {
|
||||
const global_data = getMockClient([]);
|
||||
global_data.provide.dateFnsLocale = enUS;
|
||||
global_data.plugins = [router];
|
||||
return mount(SharePostModal, {
|
||||
props: props,
|
||||
global: {
|
||||
...global_data,
|
||||
stubs: {
|
||||
RouterLink: false,
|
||||
},
|
||||
},
|
||||
});
|
||||
};
|
||||
|
||||
const post = {
|
||||
title: "hello",
|
||||
url: "https://mobilizon.fr/p/an-uuid",
|
||||
};
|
||||
|
||||
describe("SharePostModal", () => {
|
||||
it("Show public", async () => {
|
||||
const wrapper = generateWrapper({
|
||||
post: { ...post, visibility: PostVisibility.PUBLIC },
|
||||
});
|
||||
await wrapper.vm.$nextTick();
|
||||
await flushPromises();
|
||||
expect(htmlRemoveId(wrapper.html())).toMatchSnapshot();
|
||||
});
|
||||
|
||||
it("Show private", async () => {
|
||||
const wrapper = generateWrapper({
|
||||
post: post,
|
||||
});
|
||||
await wrapper.vm.$nextTick();
|
||||
await flushPromises();
|
||||
expect(htmlRemoveId(wrapper.html())).toMatchSnapshot();
|
||||
});
|
||||
});
|
||||
File diff suppressed because one or more lines are too long
@@ -5,10 +5,9 @@ import { createRouter, createWebHistory, Router } from "vue-router";
|
||||
import { config, mount } from "@vue/test-utils";
|
||||
import { Oruga } from "@oruga-ui/oruga-next";
|
||||
import flushPromises from "flush-promises";
|
||||
import { getMockClient, requestHandlers } from "../../mocks/client";
|
||||
import { getMockClient } from "../../mocks/client";
|
||||
import { htmlRemoveId } from "../../common";
|
||||
import TimelineView from "@/views/Group/TimelineView.vue";
|
||||
import { GROUP_TIMELINE } from "@/graphql/group";
|
||||
import AuthProviders from "@/components/User/AuthProviders.vue";
|
||||
|
||||
config.global.plugins.push(Oruga);
|
||||
|
||||
@@ -23,13 +22,15 @@ beforeEach(async () => {
|
||||
// await router.isReady();
|
||||
});
|
||||
|
||||
const providers = [{ id: "keycloak", label: "Entreprise" }, { id: "google" }];
|
||||
|
||||
const generateWrapper = () => {
|
||||
const global_data = getMockClient([GROUP_TIMELINE]);
|
||||
const global_data = getMockClient([]);
|
||||
global_data.provide.dateFnsLocale = enUS;
|
||||
global_data.plugins = [router];
|
||||
return mount(TimelineView, {
|
||||
return mount(AuthProviders, {
|
||||
props: {
|
||||
preferredUsername: "my-group",
|
||||
oauthProviders: providers,
|
||||
},
|
||||
global: {
|
||||
...global_data,
|
||||
@@ -40,19 +41,11 @@ const generateWrapper = () => {
|
||||
});
|
||||
};
|
||||
|
||||
describe("TimelineView", () => {
|
||||
describe("AuthProviders", () => {
|
||||
it("Show simple", async () => {
|
||||
const wrapper = generateWrapper();
|
||||
await wrapper.vm.$nextTick();
|
||||
await flushPromises();
|
||||
expect(htmlRemoveId(wrapper.html())).toMatchSnapshot();
|
||||
expect(requestHandlers.handle_0).toHaveBeenCalledTimes(1);
|
||||
expect(requestHandlers.handle_0).toHaveBeenCalledWith({
|
||||
author: undefined,
|
||||
limit: 25,
|
||||
page: 1,
|
||||
preferredUsername: "my-group",
|
||||
type: undefined,
|
||||
});
|
||||
});
|
||||
});
|
||||
@@ -1,122 +0,0 @@
|
||||
import { config, mount } from "@vue/test-utils";
|
||||
import PasswordReset from "@/views/User/PasswordReset.vue";
|
||||
import { createMockClient, RequestHandler } from "mock-apollo-client";
|
||||
import { RESET_PASSWORD } from "@/graphql/auth";
|
||||
import { resetPasswordResponseMock } from "../../mocks/auth";
|
||||
import RouteName from "@/router/name";
|
||||
import flushPromises from "flush-promises";
|
||||
import { beforeEach, describe, expect, it, vi } from "vitest";
|
||||
import { DefaultApolloClient } from "@vue/apollo-composable";
|
||||
import Oruga from "@oruga-ui/oruga-next";
|
||||
import {
|
||||
VueRouterMock,
|
||||
createRouterMock,
|
||||
injectRouterMock,
|
||||
} from "vue-router-mock";
|
||||
|
||||
config.global.plugins.push(Oruga);
|
||||
config.plugins.VueWrapper.install(VueRouterMock);
|
||||
|
||||
let requestHandlers: Record<string, RequestHandler>;
|
||||
|
||||
const generateWrapper = (
|
||||
customRequestHandlers: Record<string, RequestHandler> = {},
|
||||
customMocks = {}
|
||||
) => {
|
||||
const mockClient = createMockClient();
|
||||
|
||||
requestHandlers = {
|
||||
resetPasswordMutationHandler: vi
|
||||
.fn()
|
||||
.mockResolvedValue(resetPasswordResponseMock),
|
||||
...customRequestHandlers,
|
||||
};
|
||||
|
||||
mockClient.setRequestHandler(
|
||||
RESET_PASSWORD,
|
||||
requestHandlers.resetPasswordMutationHandler
|
||||
);
|
||||
|
||||
return mount(PasswordReset, {
|
||||
props: {
|
||||
token: "some-token",
|
||||
},
|
||||
global: {
|
||||
stubs: ["router-link", "router-view"],
|
||||
mocks: {
|
||||
...customMocks,
|
||||
},
|
||||
provide: {
|
||||
[DefaultApolloClient]: mockClient,
|
||||
},
|
||||
},
|
||||
});
|
||||
};
|
||||
|
||||
describe("Reset page", () => {
|
||||
const router = createRouterMock({
|
||||
spy: {
|
||||
create: (fn) => vi.fn(fn),
|
||||
reset: (spy) => spy.mockReset(),
|
||||
},
|
||||
});
|
||||
beforeEach(() => {
|
||||
// inject it globally to ensure `useRoute()`, `$route`, etc work
|
||||
// properly and give you access to test specific functions
|
||||
injectRouterMock(router);
|
||||
});
|
||||
|
||||
it("renders correctly", () => {
|
||||
const wrapper = generateWrapper();
|
||||
expect(wrapper.router).toBe(router);
|
||||
expect(wrapper.findAll('input[type="password"').length).toBe(2);
|
||||
const labels = wrapper.findAll("label");
|
||||
expect(labels.length).toBe(2);
|
||||
expect(labels.at(0).text()).toBe("Password");
|
||||
expect(labels.at(1).text()).toBe("Password (confirmation)");
|
||||
});
|
||||
|
||||
it("shows error if token is invalid", async () => {
|
||||
const wrapper = generateWrapper({
|
||||
resetPasswordMutationHandler: vi.fn().mockResolvedValue({
|
||||
errors: [{ message: "The token you provided is invalid." }],
|
||||
}),
|
||||
});
|
||||
|
||||
wrapper
|
||||
.findAll('input[type="password"')
|
||||
.forEach((inputField) => inputField.setValue("my password"));
|
||||
wrapper.find("form").trigger("submit");
|
||||
|
||||
await wrapper.vm.$nextTick();
|
||||
|
||||
expect(requestHandlers.resetPasswordMutationHandler).toBeCalledTimes(1);
|
||||
expect(requestHandlers.resetPasswordMutationHandler).toBeCalledWith({
|
||||
password: "my password",
|
||||
token: "some-token",
|
||||
});
|
||||
|
||||
await flushPromises();
|
||||
|
||||
expect(wrapper.find(".o-notification--danger").text()).toContain(
|
||||
"The token you provided is invalid"
|
||||
);
|
||||
});
|
||||
|
||||
it("redirects to homepage if token is valid", async () => {
|
||||
const wrapper = generateWrapper();
|
||||
|
||||
wrapper
|
||||
.findAll('input[type="password"')
|
||||
.forEach((inputField) => inputField.setValue("my password"));
|
||||
await wrapper.find("form").trigger("submit");
|
||||
|
||||
expect(requestHandlers.resetPasswordMutationHandler).toBeCalledTimes(1);
|
||||
expect(requestHandlers.resetPasswordMutationHandler).toBeCalledWith({
|
||||
password: "my password",
|
||||
token: "some-token",
|
||||
});
|
||||
await flushPromises();
|
||||
expect(wrapper.router.push).toHaveBeenCalledWith({ name: RouteName.LOGIN });
|
||||
});
|
||||
});
|
||||
@@ -1,185 +0,0 @@
|
||||
import { config, mount } from "@vue/test-utils";
|
||||
import RegisterView from "@/views/User/RegisterView.vue";
|
||||
import { createMockClient, RequestHandler } from "mock-apollo-client";
|
||||
import flushPromises from "flush-promises";
|
||||
import { configMock } from "../../mocks/config";
|
||||
import { CONFIG } from "@/graphql/config";
|
||||
import { CREATE_USER } from "@/graphql/user";
|
||||
import { beforeEach, describe, expect, it, vi } from "vitest";
|
||||
import { DefaultApolloClient } from "@vue/apollo-composable";
|
||||
import Oruga from "@oruga-ui/oruga-next";
|
||||
import {
|
||||
VueRouterMock,
|
||||
createRouterMock,
|
||||
injectRouterMock,
|
||||
} from "vue-router-mock";
|
||||
import { nullMock } from "../../common";
|
||||
|
||||
config.global.plugins.push(Oruga);
|
||||
config.plugins.VueWrapper.install(VueRouterMock);
|
||||
|
||||
let requestHandlers: Record<string, RequestHandler>;
|
||||
|
||||
const generateWrapper = (
|
||||
customRegModeration: boolean = false,
|
||||
customRequestHandlers: Record<string, RequestHandler> = {}
|
||||
) => {
|
||||
const mockClient = createMockClient();
|
||||
|
||||
const config_value = {
|
||||
...configMock,
|
||||
};
|
||||
if (customRegModeration) {
|
||||
config_value.data.config.registrationsModeration = true;
|
||||
}
|
||||
|
||||
requestHandlers = {
|
||||
configQueryHandler: vi.fn().mockResolvedValue(config_value),
|
||||
createUserHandler: vi.fn().mockResolvedValue(nullMock),
|
||||
...customRequestHandlers,
|
||||
};
|
||||
|
||||
mockClient.setRequestHandler(CONFIG, requestHandlers.configQueryHandler);
|
||||
mockClient.setRequestHandler(CREATE_USER, requestHandlers.createUserHandler);
|
||||
|
||||
return mount(RegisterView, {
|
||||
global: {
|
||||
stubs: ["router-link", "router-view"],
|
||||
provide: {
|
||||
[DefaultApolloClient]: mockClient,
|
||||
},
|
||||
},
|
||||
});
|
||||
};
|
||||
|
||||
describe("Register page", () => {
|
||||
const router = createRouterMock({
|
||||
spy: {
|
||||
create: (fn) => vi.fn(fn),
|
||||
reset: (spy) => spy.mockReset(),
|
||||
},
|
||||
});
|
||||
beforeEach(() => {
|
||||
// inject it globally to ensure `useRoute()`, `$route`, etc work
|
||||
// properly and give you access to test specific functions
|
||||
injectRouterMock(router);
|
||||
});
|
||||
|
||||
it("register without moderation", async () => {
|
||||
const wrapper = generateWrapper();
|
||||
expect(wrapper.router).toBe(router);
|
||||
await flushPromises();
|
||||
expect(wrapper.html()).toMatchSnapshot();
|
||||
expect(wrapper.find("form").exists()).toBe(true);
|
||||
wrapper.find('form input[type="email"]').setValue("some@email.tld");
|
||||
wrapper.find('form input[type="password"]').setValue("somepassword");
|
||||
wrapper.find("form").trigger("submit");
|
||||
await wrapper.vm.$nextTick();
|
||||
expect(requestHandlers.createUserHandler).toHaveBeenCalledWith({
|
||||
email: "some@email.tld",
|
||||
locale: "en_US",
|
||||
moderation: "",
|
||||
password: "somepassword",
|
||||
});
|
||||
await flushPromises();
|
||||
expect(wrapper.find("form").exists()).toBe(false);
|
||||
});
|
||||
|
||||
it("shows error without moderation email", async () => {
|
||||
const wrapper = generateWrapper(false, {
|
||||
createUserHandler: vi.fn().mockResolvedValue({
|
||||
errors: [{ field: "email", message: ["Bad email."] }],
|
||||
}),
|
||||
});
|
||||
expect(wrapper.find("form").exists()).toBe(true);
|
||||
wrapper.find('form input[type="email"]').setValue("some@email.tld");
|
||||
wrapper.find('form input[type="password"]').setValue("somepassword");
|
||||
wrapper.find("form").trigger("submit");
|
||||
await wrapper.vm.$nextTick();
|
||||
expect(requestHandlers.createUserHandler).toBeCalledTimes(1);
|
||||
expect(requestHandlers.createUserHandler).toHaveBeenCalledWith({
|
||||
email: "some@email.tld",
|
||||
locale: "en_US",
|
||||
moderation: "",
|
||||
password: "somepassword",
|
||||
});
|
||||
await flushPromises();
|
||||
expect(wrapper.find("form").exists()).toBe(true);
|
||||
expect(wrapper.find(".o-field__message-danger").text()).toContain(
|
||||
"Bad email."
|
||||
);
|
||||
});
|
||||
|
||||
it("shows error without moderation password", async () => {
|
||||
const wrapper = generateWrapper(false, {
|
||||
createUserHandler: vi.fn().mockResolvedValue({
|
||||
errors: [{ field: "password", message: ["Bad password."] }],
|
||||
}),
|
||||
});
|
||||
expect(wrapper.find("form").exists()).toBe(true);
|
||||
wrapper.find('form input[type="email"]').setValue("some@email.tld");
|
||||
wrapper.find('form input[type="password"]').setValue("somepassword");
|
||||
wrapper.find("form").trigger("submit");
|
||||
await wrapper.vm.$nextTick();
|
||||
expect(requestHandlers.createUserHandler).toBeCalledTimes(1);
|
||||
expect(requestHandlers.createUserHandler).toHaveBeenCalledWith({
|
||||
email: "some@email.tld",
|
||||
locale: "en_US",
|
||||
moderation: "",
|
||||
password: "somepassword",
|
||||
});
|
||||
await flushPromises();
|
||||
expect(wrapper.find("form").exists()).toBe(true);
|
||||
expect(wrapper.find(".o-field__message-danger").text()).toContain(
|
||||
"Bad password."
|
||||
);
|
||||
});
|
||||
|
||||
it("register with moderation", async () => {
|
||||
const wrapper = generateWrapper(true);
|
||||
expect(wrapper.router).toBe(router);
|
||||
await flushPromises();
|
||||
expect(wrapper.html()).toMatchSnapshot();
|
||||
expect(wrapper.find("form").exists()).toBe(true);
|
||||
wrapper.find('form input[type="email"]').setValue("some@email.tld");
|
||||
wrapper.find('form input[type="password"]').setValue("somepassword");
|
||||
wrapper.find("form .o-input__textarea").setValue("text for moderation");
|
||||
wrapper.find("form").trigger("submit");
|
||||
await wrapper.vm.$nextTick();
|
||||
expect(requestHandlers.createUserHandler).toHaveBeenCalledWith({
|
||||
email: "some@email.tld",
|
||||
locale: "en_US",
|
||||
moderation: "text for moderation",
|
||||
password: "somepassword",
|
||||
});
|
||||
await flushPromises();
|
||||
expect(wrapper.find("form").exists()).toBe(false);
|
||||
});
|
||||
|
||||
it("shows error with moderation", async () => {
|
||||
const wrapper = generateWrapper(true, {
|
||||
createUserHandler: vi.fn().mockResolvedValue({
|
||||
errors: [{ field: null, message: ["Bad moderation."] }],
|
||||
}),
|
||||
});
|
||||
await flushPromises();
|
||||
expect(wrapper.find("form").exists()).toBe(true);
|
||||
wrapper.find('form input[type="email"]').setValue("some@email.tld");
|
||||
wrapper.find('form input[type="password"]').setValue("somepassword");
|
||||
wrapper.find("form .o-input__textarea").setValue("text for moderation");
|
||||
wrapper.find("form").trigger("submit");
|
||||
await wrapper.vm.$nextTick();
|
||||
expect(requestHandlers.createUserHandler).toBeCalledTimes(1);
|
||||
expect(requestHandlers.createUserHandler).toHaveBeenCalledWith({
|
||||
email: "some@email.tld",
|
||||
locale: "en_US",
|
||||
moderation: "text for moderation",
|
||||
password: "somepassword",
|
||||
});
|
||||
await flushPromises();
|
||||
expect(wrapper.find("form").exists()).toBe(true);
|
||||
expect(wrapper.find(".o-field__message-danger").text()).toContain(
|
||||
"Bad moderation."
|
||||
);
|
||||
});
|
||||
});
|
||||
@@ -1,118 +0,0 @@
|
||||
import { config, mount } from "@vue/test-utils";
|
||||
import ValidateUser from "@/views/User/ValidateUser.vue";
|
||||
import { createMockClient, RequestHandler } from "mock-apollo-client";
|
||||
import flushPromises from "flush-promises";
|
||||
import { VALIDATE_USER, UPDATE_CURRENT_USER_CLIENT } from "@/graphql/user";
|
||||
import { beforeEach, describe, expect, it, vi } from "vitest";
|
||||
import { DefaultApolloClient } from "@vue/apollo-composable";
|
||||
import Oruga from "@oruga-ui/oruga-next";
|
||||
import {
|
||||
VueRouterMock,
|
||||
createRouterMock,
|
||||
injectRouterMock,
|
||||
} from "vue-router-mock";
|
||||
import { nullMock } from "../../common";
|
||||
import * as auth_mod from "@/utils/auth.ts";
|
||||
|
||||
config.global.plugins.push(Oruga);
|
||||
config.plugins.VueWrapper.install(VueRouterMock);
|
||||
|
||||
vi.spyOn(auth_mod, "saveTokenData");
|
||||
vi.spyOn(auth_mod, "saveUserData");
|
||||
|
||||
let requestHandlers: Record<string, RequestHandler>;
|
||||
|
||||
const validateUserMock = {
|
||||
data: {
|
||||
validateUser: {
|
||||
accessToken: "aaaaaaa",
|
||||
refreshToken: "zzzzzzz",
|
||||
user: {
|
||||
id: "123",
|
||||
email: "truc@machin.com",
|
||||
role: "USER",
|
||||
},
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
const generateWrapper = (moderate: boolean = false) => {
|
||||
const mockClient = createMockClient();
|
||||
const validate_user = {
|
||||
...validateUserMock,
|
||||
};
|
||||
if (moderate) {
|
||||
validate_user.data.validateUser.user.role = "PENDING";
|
||||
}
|
||||
requestHandlers = {
|
||||
validateUserHandler: vi.fn().mockResolvedValue(validateUserMock),
|
||||
updateUserHandler: vi.fn().mockResolvedValue(nullMock),
|
||||
};
|
||||
|
||||
mockClient.setRequestHandler(
|
||||
VALIDATE_USER,
|
||||
requestHandlers.validateUserHandler
|
||||
);
|
||||
mockClient.setRequestHandler(
|
||||
UPDATE_CURRENT_USER_CLIENT,
|
||||
requestHandlers.updateUserHandler
|
||||
);
|
||||
|
||||
const wrapper = mount(ValidateUser, {
|
||||
props: {
|
||||
token: "123456789",
|
||||
},
|
||||
global: {
|
||||
stubs: ["router-link", "router-view"],
|
||||
provide: {
|
||||
[DefaultApolloClient]: mockClient,
|
||||
},
|
||||
},
|
||||
});
|
||||
wrapper.router.push.mockReset();
|
||||
return wrapper;
|
||||
};
|
||||
|
||||
describe("Validate user page", () => {
|
||||
const router = createRouterMock({
|
||||
spy: {
|
||||
create: (fn) => vi.fn(fn),
|
||||
reset: (spy) => spy.mockReset(),
|
||||
},
|
||||
});
|
||||
beforeEach(() => {
|
||||
// inject it globally to ensure `useRoute()`, `$route`, etc work
|
||||
// properly and give you access to test specific functions
|
||||
injectRouterMock(router);
|
||||
});
|
||||
|
||||
it("simple", async () => {
|
||||
const wrapper = generateWrapper();
|
||||
expect(wrapper.router).toBe(router);
|
||||
await flushPromises();
|
||||
await wrapper.vm.$nextTick();
|
||||
await wrapper.vm.$nextTick();
|
||||
expect(wrapper.html()).toMatchSnapshot();
|
||||
expect(requestHandlers.validateUserHandler).toBeCalledTimes(1);
|
||||
expect(requestHandlers.validateUserHandler).toHaveBeenCalledWith({
|
||||
token: "123456789",
|
||||
});
|
||||
// expect(wrapper.router.replace).toHaveBeenCalledWith({
|
||||
// name: RouteName.CREATE_IDENTITY,
|
||||
// });
|
||||
// expect(requestHandlers.updateUserHandler).toBeCalledTimes(1);
|
||||
});
|
||||
|
||||
it("moderate", async () => {
|
||||
const wrapper = generateWrapper(true);
|
||||
expect(wrapper.router).toBe(router);
|
||||
await flushPromises();
|
||||
await wrapper.vm.$nextTick();
|
||||
expect(wrapper.html()).toMatchSnapshot();
|
||||
expect(requestHandlers.validateUserHandler).toBeCalledTimes(1);
|
||||
expect(requestHandlers.validateUserHandler).toHaveBeenCalledWith({
|
||||
token: "123456789",
|
||||
});
|
||||
expect(requestHandlers.updateUserHandler).toBeCalledTimes(0);
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,11 @@
|
||||
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
|
||||
|
||||
exports[`AuthProviders > Show simple 1`] = `
|
||||
"<div><b>Sign in with</b>
|
||||
<div class="flex gap-1 flex-wrap"><a class="o-btn o-btn--primary o-btn--outlined-primary" role="button" data-oruga="button" href="/auth/keycloak"><span class="o-btn__wrapper"><span class="o-icon o-btn__icon o-btn__icon-left" data-oruga="icon"><i class="mdi mdi-lock mdi-24px"></i></span><span class="o-btn__label"><span>Entreprise</span></span>
|
||||
<!----></span>
|
||||
</a><a class="o-btn o-btn--primary o-btn--outlined-primary" role="button" data-oruga="button" href="/auth/google"><span class="o-btn__wrapper"><span class="o-icon o-btn__icon o-btn__icon-left" data-oruga="icon"><i class="mdi mdi-google mdi-24px"></i></span><span class="o-btn__label"><span>Google</span></span>
|
||||
<!----></span>
|
||||
</a></div>
|
||||
</div>"
|
||||
`;
|
||||
@@ -1,166 +0,0 @@
|
||||
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
|
||||
|
||||
exports[`Register page > register with moderation 1`] = `
|
||||
"<div class="container mx-auto py-6">
|
||||
<section class="">
|
||||
<h1>Register an account on Mobilizon!</h1>
|
||||
<p><b>Mobilizon</b> is an instance of the <a href="https://mobilizon.org" target="_blank" class="out">Mobilizon</a> software.</p>
|
||||
</section>
|
||||
<section class="flex flex-wrap gap-6">
|
||||
<div class="">
|
||||
<div class="my-4">
|
||||
<h2 class="text-xl">Why create an account?</h2>
|
||||
<div class="prose dark:prose-invert">
|
||||
<ul>
|
||||
<li>To create and manage your events</li>
|
||||
<li>To create and manage multiples identities from a same account</li>
|
||||
<li>To register for an event by choosing one of your identities</li>
|
||||
<li>To create or join an group and start organizing with other people</li>
|
||||
<li>To follow groups and be informed of their latest events</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<router-link-stub to="[object Object]" replace="false" custom="false" ariacurrentvalue="page" viewtransition="false" class="out block my-4"></router-link-stub>
|
||||
<hr role="presentation">
|
||||
<div class="my-4">
|
||||
<h2 class="text-xl">About Mobilizon</h2>
|
||||
<div class="prose dark:prose-invert">Mobilizon.fr est l'instance Mobilizon de Framasoft.</div>
|
||||
<p>Please read the <router-link-stub to="[object Object]" replace="false" custom="false" ariacurrentvalue="page" viewtransition="false" class="out"></router-link-stub> published by <b>Mobilizon</b>'s administrators.</p>
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<!--v-if-->
|
||||
<div data-oruga="field" class="o-field">
|
||||
<!---->
|
||||
<!---->
|
||||
</div>
|
||||
<form>
|
||||
<div data-oruga="field" class="o-field"><label for="email" class="o-field__label">Email</label>
|
||||
<div class="o-field__body">
|
||||
<div class="o-field o-field--addons">
|
||||
<div data-oruga="input" class="o-input__wrapper o-input__wrapper--expanded"><input aria-required="true" required="" id="email" data-oruga-input="email" type="email" class="o-input" autocomplete="off">
|
||||
<!---->
|
||||
<!---->
|
||||
<!---->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!---->
|
||||
</div>
|
||||
<div data-oruga="field" class="o-field"><label for="password" class="o-field__label">Password</label>
|
||||
<div class="o-field__body">
|
||||
<div class="o-field o-field--addons">
|
||||
<div data-oruga="input" class="o-input__wrapper o-input__wrapper--expanded o-input__wrapper--has-icon-right"><input aria-required="true" required="" minlength="6" id="password" data-oruga-input="password" type="password" class="o-input o-input--iconspace-right" autocomplete="off">
|
||||
<!----><span class="o-icon o-icon--clickable o-input__icon-right" data-oruga="icon"><i class="mdi mdi-eye mdi-24px"></i></span>
|
||||
<!---->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!---->
|
||||
</div>
|
||||
<div data-oruga="field" class="o-field"><label for="moderation" class="o-field__label">Registration is subject to moderation, indicate your motivation.</label>
|
||||
<div class="o-field__body">
|
||||
<div class="o-field o-field--addons">
|
||||
<div data-oruga="input" class="o-input__wrapper o-input__wrapper--expanded"><textarea aria-required="true" required="" id="moderation" data-oruga-input="textarea" class="o-input o-input__textarea"></textarea>
|
||||
<!---->
|
||||
<!---->
|
||||
<!---->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!---->
|
||||
</div>
|
||||
<div class="flex items-start mb-6 mt-2">
|
||||
<div class="flex items-center h-5"><input type="checkbox" id="accept_rules_terms" class="w-4 h-4 bg-gray-50 rounded border border-gray-300 focus:ring-3 focus:ring-blue-300 dark:bg-gray-700 dark:border-gray-600 dark:focus:ring-blue-600 dark:ring-offset-gray-800" required=""></div><label for="accept_rules_terms" class="ml-2 text-gray-900 dark:text-gray-300"><span>I agree to the <router-link-stub to="[object Object]" replace="false" custom="false" ariacurrentvalue="page" viewtransition="false" class="out"></router-link-stub> and <router-link-stub to="[object Object]" replace="false" custom="false" ariacurrentvalue="page" viewtransition="false" class="out"></router-link-stub></span></label>
|
||||
</div>
|
||||
<p><button type="submit" class="o-btn o-btn--large o-btn--primary" role="button" data-oruga="button"><span class="o-btn__wrapper"><!----><span class="o-btn__label">Create an account</span>
|
||||
<!----></span>
|
||||
</button></p>
|
||||
<p class="my-6">
|
||||
<router-link-stub class="o-btn o-btn--text" role="button" data-oruga="button" to="[object Object]"></router-link-stub>
|
||||
<router-link-stub class="o-btn o-btn--text" role="button" data-oruga="button" to="[object Object]"></router-link-stub>
|
||||
</p>
|
||||
<hr role="presentation">
|
||||
<!--v-if-->
|
||||
</form>
|
||||
</div>
|
||||
</section>
|
||||
</div>"
|
||||
`;
|
||||
|
||||
exports[`Register page > register without moderation 1`] = `
|
||||
"<div class="container mx-auto py-6">
|
||||
<section class="">
|
||||
<h1>Register an account on Mobilizon!</h1>
|
||||
<p><b>Mobilizon</b> is an instance of the <a href="https://mobilizon.org" target="_blank" class="out">Mobilizon</a> software.</p>
|
||||
</section>
|
||||
<section class="flex flex-wrap gap-6">
|
||||
<div class="">
|
||||
<div class="my-4">
|
||||
<h2 class="text-xl">Why create an account?</h2>
|
||||
<div class="prose dark:prose-invert">
|
||||
<ul>
|
||||
<li>To create and manage your events</li>
|
||||
<li>To create and manage multiples identities from a same account</li>
|
||||
<li>To register for an event by choosing one of your identities</li>
|
||||
<li>To create or join an group and start organizing with other people</li>
|
||||
<li>To follow groups and be informed of their latest events</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<router-link-stub to="[object Object]" replace="false" custom="false" ariacurrentvalue="page" viewtransition="false" class="out block my-4"></router-link-stub>
|
||||
<hr role="presentation">
|
||||
<div class="my-4">
|
||||
<h2 class="text-xl">About Mobilizon</h2>
|
||||
<div class="prose dark:prose-invert">Mobilizon.fr est l'instance Mobilizon de Framasoft.</div>
|
||||
<p>Please read the <router-link-stub to="[object Object]" replace="false" custom="false" ariacurrentvalue="page" viewtransition="false" class="out"></router-link-stub> published by <b>Mobilizon</b>'s administrators.</p>
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<!--v-if-->
|
||||
<div data-oruga="field" class="o-field">
|
||||
<!---->
|
||||
<!---->
|
||||
</div>
|
||||
<form>
|
||||
<div data-oruga="field" class="o-field"><label for="email" class="o-field__label">Email</label>
|
||||
<div class="o-field__body">
|
||||
<div class="o-field o-field--addons">
|
||||
<div data-oruga="input" class="o-input__wrapper o-input__wrapper--expanded"><input aria-required="true" required="" id="email" data-oruga-input="email" type="email" class="o-input" autocomplete="off">
|
||||
<!---->
|
||||
<!---->
|
||||
<!---->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!---->
|
||||
</div>
|
||||
<div data-oruga="field" class="o-field"><label for="password" class="o-field__label">Password</label>
|
||||
<div class="o-field__body">
|
||||
<div class="o-field o-field--addons">
|
||||
<div data-oruga="input" class="o-input__wrapper o-input__wrapper--expanded o-input__wrapper--has-icon-right"><input aria-required="true" required="" minlength="6" id="password" data-oruga-input="password" type="password" class="o-input o-input--iconspace-right" autocomplete="off">
|
||||
<!----><span class="o-icon o-icon--clickable o-input__icon-right" data-oruga="icon"><i class="mdi mdi-eye mdi-24px"></i></span>
|
||||
<!---->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!---->
|
||||
</div>
|
||||
<!--v-if-->
|
||||
<div class="flex items-start mb-6 mt-2">
|
||||
<div class="flex items-center h-5"><input type="checkbox" id="accept_rules_terms" class="w-4 h-4 bg-gray-50 rounded border border-gray-300 focus:ring-3 focus:ring-blue-300 dark:bg-gray-700 dark:border-gray-600 dark:focus:ring-blue-600 dark:ring-offset-gray-800" required=""></div><label for="accept_rules_terms" class="ml-2 text-gray-900 dark:text-gray-300"><span>I agree to the <router-link-stub to="[object Object]" replace="false" custom="false" ariacurrentvalue="page" viewtransition="false" class="out"></router-link-stub> and <router-link-stub to="[object Object]" replace="false" custom="false" ariacurrentvalue="page" viewtransition="false" class="out"></router-link-stub></span></label>
|
||||
</div>
|
||||
<p><button type="submit" class="o-btn o-btn--large o-btn--primary" role="button" data-oruga="button"><span class="o-btn__wrapper"><!----><span class="o-btn__label">Create an account</span>
|
||||
<!----></span>
|
||||
</button></p>
|
||||
<p class="my-6">
|
||||
<router-link-stub class="o-btn o-btn--text" role="button" data-oruga="button" to="[object Object]"></router-link-stub>
|
||||
<router-link-stub class="o-btn o-btn--text" role="button" data-oruga="button" to="[object Object]"></router-link-stub>
|
||||
</p>
|
||||
<hr role="presentation">
|
||||
<!--v-if-->
|
||||
</form>
|
||||
</div>
|
||||
</section>
|
||||
</div>"
|
||||
`;
|
||||
@@ -1,16 +0,0 @@
|
||||
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
|
||||
|
||||
exports[`Validate user page > moderate 1`] = `
|
||||
"<section class="container mx-auto">
|
||||
<div>
|
||||
<h1 class="title">Your account has been validated</h1>
|
||||
<h2 class="title">A moderator will take care of your request.</h2>
|
||||
</div>
|
||||
</section>"
|
||||
`;
|
||||
|
||||
exports[`Validate user page > simple 1`] = `
|
||||
"<section class="container mx-auto">
|
||||
<h1 class="title">Your account is being validated</h1>
|
||||
</section>"
|
||||
`;
|
||||
@@ -1,9 +0,0 @@
|
||||
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
|
||||
|
||||
exports[`EmailValidate > Show simple 1`] = `
|
||||
"<section class="container mx-auto">
|
||||
<div>
|
||||
<h1 class="title">Your email has been changed</h1>
|
||||
</div>
|
||||
</section>"
|
||||
`;
|
||||
@@ -1,3 +0,0 @@
|
||||
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
|
||||
|
||||
exports[`ProviderValidation > Show simple 1`] = `"<p>Redirecting in progress…</p>"`;
|
||||
@@ -1,54 +0,0 @@
|
||||
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
|
||||
|
||||
exports[`ResendConfirmation > Show simple 1`] = `
|
||||
"<section class="container mx-auto pt-4 max-w-2xl">
|
||||
<h1>Resend confirmation email</h1>
|
||||
<!--v-if-->
|
||||
<form>
|
||||
<div data-oruga="field" class="o-field"><label for="emailAddress" class="o-field__label">Email address</label>
|
||||
<div class="o-field__body">
|
||||
<div class="o-field o-field--addons">
|
||||
<div data-oruga="input" class="o-input__wrapper o-input__wrapper--expanded"><input aria-required="true" required="" id="emailAddress" data-oruga-input="email" type="email" class="o-input" autocomplete="off">
|
||||
<!---->
|
||||
<!---->
|
||||
<!---->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!---->
|
||||
</div>
|
||||
<p class="flex flex-wrap gap-1 mt-2"><button type="submit" class="o-btn o-btn--primary" role="button" data-oruga="button"><span class="o-btn__wrapper"><!----><span class="o-btn__label">Send the confirmation email again</span>
|
||||
<!----></span>
|
||||
</button><a href="/login" class="o-btn o-btn--primary o-btn--outlined-primary" role="button" data-oruga="button"><span class="o-btn__wrapper"><!----><span class="o-btn__label">Cancel</span>
|
||||
<!----></span>
|
||||
</a></p>
|
||||
</form>
|
||||
</section>"
|
||||
`;
|
||||
|
||||
exports[`ResendConfirmation > Show simple 2`] = `
|
||||
"<section class="container mx-auto pt-4 max-w-2xl">
|
||||
<h1>Resend confirmation email</h1>
|
||||
<!--v-if-->
|
||||
<div>
|
||||
<transition-stub name="fade" appear="false" persisted="false" css="true">
|
||||
<article title="Success" class="o-notification o-notification--success o-notification--top" data-oruga="notification">
|
||||
<!---->
|
||||
<div class="o-notification__wrapper">
|
||||
<!---->
|
||||
<div class="o-notification__content">If an account with this email exists, we just sent another confirmation email to some@email.tld</div>
|
||||
</div>
|
||||
</article>
|
||||
</transition-stub>
|
||||
<transition-stub name="fade" appear="false" persisted="false" css="true">
|
||||
<article class="mt-2 o-notification o-notification--info o-notification--top" data-oruga="notification">
|
||||
<!---->
|
||||
<div class="o-notification__wrapper">
|
||||
<!---->
|
||||
<div class="o-notification__content">Please check your spam folder if you didn't receive the email.</div>
|
||||
</div>
|
||||
</article>
|
||||
</transition-stub>
|
||||
</div>
|
||||
</section>"
|
||||
`;
|
||||
@@ -1,54 +0,0 @@
|
||||
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
|
||||
|
||||
exports[`SendPasswordReset > Show simple 1`] = `
|
||||
"<section class="container mx-auto">
|
||||
<h1>Forgot your password?</h1>
|
||||
<p>Enter your email address below, and we'll email you instructions on how to change your password.</p>
|
||||
<form>
|
||||
<div data-oruga="field" class="o-field o-field--filled"><label class="o-field__label" for="">Email address</label>
|
||||
<div class="o-field__body">
|
||||
<div class="o-field o-field--addons">
|
||||
<div data-oruga="input" class="o-input__wrapper o-input__wrapper--expanded"><input aria-required="true" required="" id="" data-oruga-input="email" type="email" class="o-input" autocomplete="off">
|
||||
<!---->
|
||||
<!---->
|
||||
<!---->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!---->
|
||||
</div>
|
||||
<p class="my-4 flex gap-2"><button type="submit" class="o-btn o-btn--primary" role="button" data-oruga="button"><span class="o-btn__wrapper"><!----><span class="o-btn__label">Submit</span>
|
||||
<!----></span>
|
||||
</button><a href="/login" class="o-btn o-btn--text" role="button" data-oruga="button"><span class="o-btn__wrapper"><!----><span class="o-btn__label">Cancel</span>
|
||||
<!----></span>
|
||||
</a></p>
|
||||
</form>
|
||||
</section>"
|
||||
`;
|
||||
|
||||
exports[`SendPasswordReset > Show simple 2`] = `
|
||||
"<section class="container mx-auto">
|
||||
<h1>Forgot your password?</h1>
|
||||
<p>Enter your email address below, and we'll email you instructions on how to change your password.</p>
|
||||
<div>
|
||||
<transition-stub name="fade" appear="false" persisted="false" css="true">
|
||||
<article class="my-2 o-notification o-notification--success o-notification--top" title="Success" data-oruga="notification">
|
||||
<!---->
|
||||
<div class="o-notification__wrapper">
|
||||
<!---->
|
||||
<div class="o-notification__content">We just sent an email to some@email.tld</div>
|
||||
</div>
|
||||
</article>
|
||||
</transition-stub>
|
||||
<transition-stub name="fade" appear="false" persisted="false" css="true">
|
||||
<article class="my-2 o-notification o-notification--info o-notification--top" data-oruga="notification">
|
||||
<!---->
|
||||
<div class="o-notification__wrapper">
|
||||
<!---->
|
||||
<div class="o-notification__content">Please check your spam folder if you didn't receive the email.</div>
|
||||
</div>
|
||||
</article>
|
||||
</transition-stub>
|
||||
</div>
|
||||
</section>"
|
||||
`;
|
||||
@@ -1,37 +0,0 @@
|
||||
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
|
||||
|
||||
exports[`SettingsOnboard > Show simple - step 1 1`] = `
|
||||
"<div data-v-68ff875c="" class="container mx-auto">
|
||||
<h1 data-v-68ff875c="" class="title">Let's define a few settings</h1>
|
||||
<o-steps-stub data-v-68ff875c="" modelvalue="0" vertical="false" iconprev="chevron-left" iconnext="chevron-right" hasnavigation="false" destroyonhide="false" animated="true" animation="slide-next,slide-prev,slide-down,slide-up" animateinitially="false" labelposition="bottom" rounded="true"></o-steps-stub>
|
||||
<section data-v-68ff875c="" class="has-text-centered section buttons">
|
||||
<o-button-stub data-v-68ff875c="" tag="router-link" rounded="false" expanded="false" disabled="true" outlined="true" loading="false" inverted="false" nativetype="button" role="button" iconboth="false" to="[object Object]"></o-button-stub>
|
||||
<o-button-stub data-v-68ff875c="" tag="router-link" variant="success" rounded="false" expanded="false" disabled="false" outlined="true" loading="false" inverted="false" nativetype="button" role="button" iconboth="false" to="[object Object]"></o-button-stub>
|
||||
<!--v-if-->
|
||||
</section>
|
||||
</div>"
|
||||
`;
|
||||
|
||||
exports[`SettingsOnboard > Show simple - step 2 1`] = `
|
||||
"<div data-v-68ff875c="" class="container mx-auto">
|
||||
<h1 data-v-68ff875c="" class="title">Let's define a few settings</h1>
|
||||
<o-steps-stub data-v-68ff875c="" modelvalue="1" vertical="false" iconprev="chevron-left" iconnext="chevron-right" hasnavigation="false" destroyonhide="false" animated="true" animation="slide-next,slide-prev,slide-down,slide-up" animateinitially="false" labelposition="bottom" rounded="true"></o-steps-stub>
|
||||
<section data-v-68ff875c="" class="has-text-centered section buttons">
|
||||
<o-button-stub data-v-68ff875c="" tag="router-link" rounded="false" expanded="false" disabled="false" outlined="true" loading="false" inverted="false" nativetype="button" role="button" iconboth="false" to="[object Object]"></o-button-stub>
|
||||
<o-button-stub data-v-68ff875c="" tag="router-link" variant="success" rounded="false" expanded="false" disabled="false" outlined="true" loading="false" inverted="false" nativetype="button" role="button" iconboth="false" to="[object Object]"></o-button-stub>
|
||||
<!--v-if-->
|
||||
</section>
|
||||
</div>"
|
||||
`;
|
||||
|
||||
exports[`SettingsOnboard > Show simple - step 3 1`] = `
|
||||
"<div data-v-68ff875c="" class="container mx-auto">
|
||||
<h1 data-v-68ff875c="" class="title">Let's define a few settings</h1>
|
||||
<o-steps-stub data-v-68ff875c="" modelvalue="2" vertical="false" iconprev="chevron-left" iconnext="chevron-right" hasnavigation="false" destroyonhide="false" animated="true" animation="slide-next,slide-prev,slide-down,slide-up" animateinitially="false" labelposition="bottom" rounded="true"></o-steps-stub>
|
||||
<section data-v-68ff875c="" class="has-text-centered section buttons">
|
||||
<o-button-stub data-v-68ff875c="" tag="router-link" rounded="false" expanded="false" disabled="false" outlined="true" loading="false" inverted="false" nativetype="button" role="button" iconboth="false" to="[object Object]"></o-button-stub>
|
||||
<!--v-if-->
|
||||
<o-button-stub data-v-68ff875c="" tag="router-link" variant="success" size="big" rounded="false" expanded="false" disabled="false" outlined="false" loading="false" inverted="false" nativetype="button" role="button" iconboth="false" to="[object Object]"></o-button-stub>
|
||||
</section>
|
||||
</div>"
|
||||
`;
|
||||
@@ -1,59 +0,0 @@
|
||||
import { beforeEach, describe, it, expect } from "vitest";
|
||||
import { enUS } from "date-fns/locale";
|
||||
import { routes } from "@/router";
|
||||
import { createRouter, createWebHistory, Router } from "vue-router";
|
||||
import { getMockClient, requestHandlers } from "../../mocks/client";
|
||||
import EmailValidate from "@/views/User/EmailValidate.vue";
|
||||
import { config, mount } from "@vue/test-utils";
|
||||
import { Oruga } from "@oruga-ui/oruga-next";
|
||||
import flushPromises from "flush-promises";
|
||||
import { VALIDATE_EMAIL } from "@/graphql/user";
|
||||
|
||||
config.global.plugins.push(Oruga);
|
||||
|
||||
let router: Router;
|
||||
|
||||
beforeEach(async () => {
|
||||
router = createRouter({
|
||||
history: createWebHistory(),
|
||||
routes: routes,
|
||||
});
|
||||
|
||||
// await router.isReady();
|
||||
});
|
||||
|
||||
const email_mock = {
|
||||
data: {
|
||||
id: "987654",
|
||||
},
|
||||
};
|
||||
|
||||
const generateWrapper = (mock_email = {}) => {
|
||||
const global_data = getMockClient([[VALIDATE_EMAIL, mock_email]]);
|
||||
global_data.provide.dateFnsLocale = enUS;
|
||||
global_data.plugins = [router];
|
||||
return mount(EmailValidate, {
|
||||
props: {
|
||||
token: "azerty123456789",
|
||||
},
|
||||
global: {
|
||||
...global_data,
|
||||
stubs: {
|
||||
RouterLink: false,
|
||||
},
|
||||
},
|
||||
});
|
||||
};
|
||||
|
||||
describe("EmailValidate", () => {
|
||||
it("Show simple", async () => {
|
||||
const wrapper = generateWrapper(email_mock);
|
||||
await wrapper.vm.$nextTick();
|
||||
await flushPromises();
|
||||
expect(wrapper.html()).toMatchSnapshot();
|
||||
expect(requestHandlers.handle_0).toHaveBeenCalledTimes(1);
|
||||
expect(requestHandlers.handle_0).toHaveBeenCalledWith({
|
||||
token: "azerty123456789",
|
||||
});
|
||||
});
|
||||
});
|
||||
@@ -1,201 +0,0 @@
|
||||
import { config, mount, VueWrapper } from "@vue/test-utils";
|
||||
import Login from "@/views/User/LoginView.vue";
|
||||
import {
|
||||
createMockClient,
|
||||
MockApolloClient,
|
||||
RequestHandler,
|
||||
} from "mock-apollo-client";
|
||||
import buildCurrentUserResolver from "@/apollo/user";
|
||||
import { loginMock as loginConfigMock } from "../../mocks/config";
|
||||
import { CONFIG } from "@/graphql/config";
|
||||
import {
|
||||
loginMock,
|
||||
loginResponseMock,
|
||||
nullIdentityMock,
|
||||
} from "../../mocks/auth";
|
||||
import { LOGIN } from "@/graphql/auth";
|
||||
import {
|
||||
CURRENT_USER_CLIENT,
|
||||
LOGGED_USER_LOCATION,
|
||||
UPDATE_CURRENT_USER_CLIENT,
|
||||
} from "@/graphql/user";
|
||||
import { ICurrentUser } from "@/types/current-user.model";
|
||||
import flushPromises from "flush-promises";
|
||||
import RouteName from "@/router/name";
|
||||
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
|
||||
import { DefaultApolloClient } from "@vue/apollo-composable";
|
||||
import Oruga from "@oruga-ui/oruga-next";
|
||||
import { cache } from "@/apollo/memory";
|
||||
import {
|
||||
VueRouterMock,
|
||||
createRouterMock,
|
||||
injectRouterMock,
|
||||
getRouter,
|
||||
} from "vue-router-mock";
|
||||
import { IDENTITIES } from "@/graphql/actor";
|
||||
import { nullMock } from "../../common";
|
||||
|
||||
config.global.plugins.push(Oruga);
|
||||
config.plugins.VueWrapper.install(VueRouterMock);
|
||||
|
||||
describe("Render login form", () => {
|
||||
let wrapper: VueWrapper;
|
||||
let mockClient: MockApolloClient | null;
|
||||
let requestHandlers: Record<string, RequestHandler>;
|
||||
|
||||
const router = createRouterMock({
|
||||
spy: {
|
||||
create: (fn) => vi.fn(fn),
|
||||
reset: (spy) => spy.mockReset(),
|
||||
},
|
||||
});
|
||||
beforeEach(() => {
|
||||
// inject it globally to ensure `useRoute()`, `$route`, etc work
|
||||
// properly and give you access to test specific functions
|
||||
injectRouterMock(router);
|
||||
});
|
||||
|
||||
const generateWrapper = (
|
||||
handlers: Record<string, unknown> = {},
|
||||
customProps: Record<string, unknown> = {},
|
||||
customMocks: Record<string, unknown> = {}
|
||||
) => {
|
||||
mockClient = createMockClient({
|
||||
cache,
|
||||
resolvers: buildCurrentUserResolver(cache),
|
||||
});
|
||||
|
||||
requestHandlers = {
|
||||
configQueryHandler: vi.fn().mockResolvedValue(loginConfigMock),
|
||||
loginMutationHandler: vi.fn().mockResolvedValue(loginResponseMock),
|
||||
identity: vi.fn().mockResolvedValue(nullIdentityMock),
|
||||
mockhdl: vi.fn().mockResolvedValue(nullMock),
|
||||
...handlers,
|
||||
};
|
||||
mockClient.setRequestHandler(CONFIG, requestHandlers.configQueryHandler);
|
||||
mockClient.setRequestHandler(LOGIN, requestHandlers.loginMutationHandler);
|
||||
mockClient.setRequestHandler(IDENTITIES, requestHandlers.identity);
|
||||
mockClient.setRequestHandler(LOGGED_USER_LOCATION, requestHandlers.mockhdl);
|
||||
mockClient.setRequestHandler(
|
||||
UPDATE_CURRENT_USER_CLIENT,
|
||||
requestHandlers.mockhdl
|
||||
);
|
||||
|
||||
wrapper = mount(Login, {
|
||||
props: {
|
||||
...customProps,
|
||||
},
|
||||
mocks: {
|
||||
...customMocks,
|
||||
},
|
||||
stubs: ["router-link", "router-view"],
|
||||
global: {
|
||||
provide: {
|
||||
[DefaultApolloClient]: mockClient,
|
||||
},
|
||||
},
|
||||
});
|
||||
wrapper.router.push.mockReset();
|
||||
};
|
||||
|
||||
afterEach(() => {
|
||||
wrapper?.unmount();
|
||||
cache.reset();
|
||||
mockClient = null;
|
||||
});
|
||||
|
||||
it("requires email and password to be filled", async () => {
|
||||
generateWrapper();
|
||||
await wrapper.vm.$nextTick();
|
||||
await wrapper.vm.$nextTick();
|
||||
await flushPromises();
|
||||
|
||||
expect(wrapper.exists()).toBe(true);
|
||||
expect(requestHandlers.configQueryHandler).toHaveBeenCalled();
|
||||
wrapper.find('form input[type="email"]').setValue("");
|
||||
wrapper.find('form input[type="password"]').setValue("");
|
||||
wrapper.find('form button[type="submit"]').trigger("click");
|
||||
const form = wrapper.find("form");
|
||||
expect(form.exists()).toBe(true);
|
||||
const formElement = form.element as HTMLFormElement;
|
||||
expect(formElement.checkValidity()).toBe(false);
|
||||
});
|
||||
|
||||
it("renders and submits the login form", async () => {
|
||||
generateWrapper();
|
||||
await wrapper.vm.$nextTick();
|
||||
await wrapper.vm.$nextTick();
|
||||
await flushPromises();
|
||||
|
||||
expect(wrapper.exists()).toBe(true);
|
||||
expect(requestHandlers.configQueryHandler).toHaveBeenCalled();
|
||||
wrapper.find('form input[type="email"]').setValue("some@email.tld");
|
||||
wrapper.find('form input[type="password"]').setValue("somepassword");
|
||||
wrapper.find("form").trigger("submit");
|
||||
await wrapper.vm.$nextTick();
|
||||
expect(requestHandlers.loginMutationHandler).toHaveBeenCalledWith({
|
||||
...loginMock,
|
||||
});
|
||||
await flushPromises();
|
||||
const currentUser = mockClient?.cache.readQuery<{
|
||||
currentUser: ICurrentUser;
|
||||
}>({
|
||||
query: CURRENT_USER_CLIENT,
|
||||
})?.currentUser;
|
||||
|
||||
await flushPromises();
|
||||
expect(currentUser?.email).toBe("some@email.tld");
|
||||
expect(currentUser?.id).toBe("1");
|
||||
await flushPromises();
|
||||
expect(wrapper.router.replace).toHaveBeenCalledWith({
|
||||
name: RouteName.HOME,
|
||||
});
|
||||
});
|
||||
|
||||
it("handles a login error", async () => {
|
||||
generateWrapper({
|
||||
loginMutationHandler: vi.fn().mockResolvedValue({
|
||||
errors: [
|
||||
{
|
||||
message:
|
||||
'"Impossible to authenticate, either your email or password are invalid."',
|
||||
},
|
||||
],
|
||||
}),
|
||||
});
|
||||
|
||||
await wrapper.vm.$nextTick();
|
||||
await wrapper.vm.$nextTick();
|
||||
await flushPromises();
|
||||
|
||||
expect(wrapper.exists()).toBe(true);
|
||||
expect(requestHandlers.configQueryHandler).toHaveBeenCalled();
|
||||
wrapper.find('form input[type="email"]').setValue("some@email.tld");
|
||||
wrapper.find('form input[type="password"]').setValue("somepassword");
|
||||
wrapper.find("form").trigger("submit");
|
||||
await wrapper.vm.$nextTick();
|
||||
expect(requestHandlers.loginMutationHandler).toHaveBeenCalledWith({
|
||||
...loginMock,
|
||||
});
|
||||
await flushPromises();
|
||||
expect(wrapper.find(".o-notification--danger").text()).toContain(
|
||||
"Impossible to authenticate, either your email or password are invalid."
|
||||
);
|
||||
expect(wrapper.router.push).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it("handles redirection after login", async () => {
|
||||
generateWrapper();
|
||||
getRouter().setQuery({ redirect: "/about/instance" });
|
||||
|
||||
await wrapper.vm.$nextTick();
|
||||
await wrapper.vm.$nextTick();
|
||||
await flushPromises();
|
||||
|
||||
wrapper.find('form input[type="email"]').setValue("some@email.tld");
|
||||
wrapper.find('form input[type="password"]').setValue("somepassword");
|
||||
wrapper.find("form").trigger("submit");
|
||||
await flushPromises();
|
||||
expect(wrapper.router.push).toHaveBeenCalledWith("/about/instance");
|
||||
});
|
||||
});
|
||||
@@ -1,72 +0,0 @@
|
||||
import { beforeEach, describe, it, expect, vi } from "vitest";
|
||||
import { enUS } from "date-fns/locale";
|
||||
import { routes } from "@/router";
|
||||
import { createRouter, createWebHistory, Router } from "vue-router";
|
||||
import { getMockClient, requestHandlers } from "../../mocks/client";
|
||||
import ProviderValidation from "@/views/User/ProviderValidation.vue";
|
||||
import { config, mount } from "@vue/test-utils";
|
||||
import { Oruga } from "@oruga-ui/oruga-next";
|
||||
import flushPromises from "flush-promises";
|
||||
import { UPDATE_CURRENT_USER_CLIENT, LOGGED_USER } from "@/graphql/user";
|
||||
|
||||
vi.mock("@/utils/html", () => {
|
||||
return {
|
||||
getValueFromMeta: (name: string) => name,
|
||||
escapeHtml: (html: string) => html,
|
||||
};
|
||||
});
|
||||
config.global.plugins.push(Oruga);
|
||||
|
||||
let router: Router;
|
||||
|
||||
beforeEach(async () => {
|
||||
router = createRouter({
|
||||
history: createWebHistory(),
|
||||
routes: routes,
|
||||
});
|
||||
|
||||
// await router.isReady();
|
||||
});
|
||||
|
||||
const logged_mock = {
|
||||
data: {
|
||||
loggedUser: {
|
||||
__typename: "User",
|
||||
defaultActor: {
|
||||
__typename: "Person",
|
||||
id: "1",
|
||||
unreadConversationsCount: 0,
|
||||
},
|
||||
id: "1",
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
const generateWrapper = (mock_logged = {}) => {
|
||||
const global_data = getMockClient([
|
||||
[LOGGED_USER, mock_logged],
|
||||
UPDATE_CURRENT_USER_CLIENT,
|
||||
]);
|
||||
global_data.provide.dateFnsLocale = enUS;
|
||||
global_data.plugins = [router];
|
||||
return mount(ProviderValidation, {
|
||||
global: {
|
||||
...global_data,
|
||||
stubs: {
|
||||
RouterLink: false,
|
||||
},
|
||||
},
|
||||
});
|
||||
};
|
||||
|
||||
describe("ProviderValidation", () => {
|
||||
it("Show simple", async () => {
|
||||
const wrapper = generateWrapper(logged_mock);
|
||||
await wrapper.vm.$nextTick();
|
||||
await flushPromises();
|
||||
expect(wrapper.html()).toMatchSnapshot();
|
||||
expect(requestHandlers.handle_1).toHaveBeenCalledTimes(0);
|
||||
expect(requestHandlers.handle_0).toHaveBeenCalledTimes(1);
|
||||
expect(requestHandlers.handle_0).toHaveBeenCalledWith({});
|
||||
});
|
||||
});
|
||||
@@ -1,57 +0,0 @@
|
||||
import { beforeEach, describe, it, expect } from "vitest";
|
||||
import { enUS } from "date-fns/locale";
|
||||
import { routes } from "@/router";
|
||||
import { createRouter, createWebHistory, Router } from "vue-router";
|
||||
import { getMockClient, requestHandlers } from "../../mocks/client";
|
||||
import ResendConfirmation from "@/views/User/ResendConfirmation.vue";
|
||||
import { config, mount } from "@vue/test-utils";
|
||||
import { Oruga } from "@oruga-ui/oruga-next";
|
||||
import flushPromises from "flush-promises";
|
||||
import { RESEND_CONFIRMATION_EMAIL } from "@/graphql/auth";
|
||||
|
||||
config.global.plugins.push(Oruga);
|
||||
|
||||
let router: Router;
|
||||
|
||||
beforeEach(async () => {
|
||||
router = createRouter({
|
||||
history: createWebHistory(),
|
||||
routes: routes,
|
||||
});
|
||||
|
||||
// await router.isReady();
|
||||
});
|
||||
|
||||
const generateWrapper = () => {
|
||||
const global_data = getMockClient([RESEND_CONFIRMATION_EMAIL]);
|
||||
global_data.provide.dateFnsLocale = enUS;
|
||||
global_data.plugins = [router];
|
||||
return mount(ResendConfirmation, {
|
||||
global: {
|
||||
...global_data,
|
||||
stubs: {
|
||||
RouterLink: false,
|
||||
},
|
||||
},
|
||||
});
|
||||
};
|
||||
|
||||
describe("ResendConfirmation", () => {
|
||||
it("Show simple", async () => {
|
||||
const wrapper = generateWrapper();
|
||||
await wrapper.vm.$nextTick();
|
||||
await flushPromises();
|
||||
expect(wrapper.html()).toMatchSnapshot();
|
||||
expect(requestHandlers.handle_0).toHaveBeenCalledTimes(0);
|
||||
|
||||
wrapper.find('form input[type="email"]').setValue("some@email.tld");
|
||||
wrapper.find("form").trigger("submit");
|
||||
await flushPromises();
|
||||
expect(wrapper.html()).toMatchSnapshot();
|
||||
|
||||
expect(requestHandlers.handle_0).toHaveBeenCalledTimes(1);
|
||||
expect(requestHandlers.handle_0).toHaveBeenCalledWith({
|
||||
email: "some@email.tld",
|
||||
});
|
||||
});
|
||||
});
|
||||
@@ -1,73 +0,0 @@
|
||||
import { beforeEach, describe, it, expect } from "vitest";
|
||||
import { enUS } from "date-fns/locale";
|
||||
import { routes } from "@/router";
|
||||
import { createRouter, createWebHistory, Router } from "vue-router";
|
||||
import { getMockClient, requestHandlers } from "../../mocks/client";
|
||||
import SettingsOnboard from "@/views/User/SettingsOnboard.vue";
|
||||
import { config, shallowMount } from "@vue/test-utils";
|
||||
import { Oruga } from "@oruga-ui/oruga-next";
|
||||
import flushPromises from "flush-promises";
|
||||
import { USER_SETTINGS } from "@/graphql/user";
|
||||
|
||||
config.global.plugins.push(Oruga);
|
||||
|
||||
let router: Router;
|
||||
|
||||
beforeEach(async () => {
|
||||
router = createRouter({
|
||||
history: createWebHistory(),
|
||||
routes: routes,
|
||||
});
|
||||
|
||||
// await router.isReady();
|
||||
});
|
||||
|
||||
const settings_mock = {
|
||||
data: {},
|
||||
};
|
||||
|
||||
const generateWrapper = (mock_settings = {}, step) => {
|
||||
const global_data = getMockClient([[USER_SETTINGS, mock_settings]]);
|
||||
global_data.provide.dateFnsLocale = enUS;
|
||||
global_data.plugins = [router];
|
||||
return shallowMount(SettingsOnboard, {
|
||||
props: {
|
||||
step: step,
|
||||
},
|
||||
global: {
|
||||
...global_data,
|
||||
stubs: {
|
||||
RouterLink: false,
|
||||
},
|
||||
},
|
||||
});
|
||||
};
|
||||
|
||||
describe("SettingsOnboard", () => {
|
||||
it("Show simple - step 1", async () => {
|
||||
const wrapper = generateWrapper(settings_mock, 1);
|
||||
await wrapper.vm.$nextTick();
|
||||
await flushPromises();
|
||||
expect(wrapper.html()).toMatchSnapshot();
|
||||
expect(requestHandlers.handle_0).toHaveBeenCalledTimes(1);
|
||||
expect(requestHandlers.handle_0).toHaveBeenCalledWith({});
|
||||
});
|
||||
|
||||
it("Show simple - step 2", async () => {
|
||||
const wrapper = generateWrapper(settings_mock, 2);
|
||||
await wrapper.vm.$nextTick();
|
||||
await flushPromises();
|
||||
expect(wrapper.html()).toMatchSnapshot();
|
||||
expect(requestHandlers.handle_0).toHaveBeenCalledTimes(1);
|
||||
expect(requestHandlers.handle_0).toHaveBeenCalledWith({});
|
||||
});
|
||||
|
||||
it("Show simple - step 3", async () => {
|
||||
const wrapper = generateWrapper(settings_mock, 3);
|
||||
await wrapper.vm.$nextTick();
|
||||
await flushPromises();
|
||||
expect(wrapper.html()).toMatchSnapshot();
|
||||
expect(requestHandlers.handle_0).toHaveBeenCalledTimes(1);
|
||||
expect(requestHandlers.handle_0).toHaveBeenCalledWith({});
|
||||
});
|
||||
});
|
||||
@@ -1,256 +0,0 @@
|
||||
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
|
||||
|
||||
exports[`AdminGroupProfile > Show simple 1`] = `
|
||||
"<div class="section">
|
||||
<breadcrumbs-nav links="[object Object],[object Object],[object Object]"></breadcrumbs-nav>
|
||||
<div><a href="/@group_name@domain" class="mx-auto max-w-sm block mb-2">
|
||||
<div data-v-b0ff4ece="" class="bg-white dark:bg-mbz-purple rounded-lg flex space-x-4 items-center flex-col p-4 shadow-md sm:p-8 pb-10 w-80">
|
||||
<div data-v-b0ff4ece="" class="flex pl-2"><span data-v-b0ff4ece="" class="ltr:-mr-0.5 rtl:-ml-0.5 material-design-icon account-circle-icon ltr:-mr-0.5 rtl:-ml-0.5" aria-hidden="true" role="img"><svg fill="currentColor" class="material-design-icon__svg" width="48" height="48" viewBox="0 0 24 24"><path d="M12,19.2C9.5,19.2 7.29,17.92 6,16C6.03,14 10,12.9 12,12.9C14,12.9 17.97,14 18,16C16.71,17.92 14.5,19.2 12,19.2M12,5A3,3 0 0,1 15,8A3,3 0 0,1 12,11A3,3 0 0,1 9,8A3,3 0 0,1 12,5M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12C22,6.47 17.5,2 12,2Z"><!--v-if--></path></svg></span></div>
|
||||
<div data-v-b0ff4ece="" class="text-center overflow-hidden w-full">
|
||||
<h5 data-v-b0ff4ece="" class="text-xl font-medium violet-title tracking-tight text-gray-900 dark:text-gray-200 whitespace-pre-line line-clamp-2">Group name</h5>
|
||||
<p data-v-b0ff4ece="" class="text-gray-500 dark:text-gray-200 truncate"><span data-v-b0ff4ece="" dir="ltr">@group_name@domain</span></p>
|
||||
<div data-v-b0ff4ece="" class="only-first-child line-clamp-10"></div>
|
||||
<!--v-if-->
|
||||
</div>
|
||||
<!--v-if-->
|
||||
</div>
|
||||
<!-- <div
|
||||
class="p-4 bg-white rounded-lg shadow-md sm:p-8 flex items-center space-x-4"
|
||||
dir="auto"
|
||||
>
|
||||
<div class="flex-shrink-0">
|
||||
<figure class="w-12 h-12" v-if="actor.avatar">
|
||||
<img
|
||||
class="rounded-lg"
|
||||
:src="actor.avatar.url"
|
||||
alt=""
|
||||
width="48"
|
||||
height="48"
|
||||
/>
|
||||
</figure>
|
||||
<o-icon
|
||||
v-else
|
||||
size="large"
|
||||
icon="account-circle"
|
||||
class="ltr:-mr-0.5 rtl:-ml-0.5"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div class="flex-1 min-w-0">
|
||||
<h5 class="text-xl font-medium violet-title tracking-tight text-gray-900">
|
||||
{{ displayName(actor) }}
|
||||
</h5>
|
||||
<p class="text-gray-500 truncate" v-if="actor.name">
|
||||
<span dir="ltr">@{{ usernameWithDomain(actor) }}</span>
|
||||
</p>
|
||||
<div
|
||||
v-if="full"
|
||||
class="line-clamp-3"
|
||||
:class="{ limit: limit }"
|
||||
v-html="actor.summary"
|
||||
/>
|
||||
</div>
|
||||
</div> -->
|
||||
</a></div>
|
||||
<table class="table w-full">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>Status</td>
|
||||
<td>Active</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Domain</td>
|
||||
<td>domain</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Uploaded media size</td>
|
||||
<td>0 octet</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<div class="flex gap-1"><button type="button" class="o-btn o-btn--primary" role="button" data-oruga="button"><span class="o-btn__wrapper"><!----><span class="o-btn__label">Suspend</span>
|
||||
<!----></span>
|
||||
</button>
|
||||
<!--v-if--><button type="button" class="o-btn o-btn--primary o-btn--outlined-primary" role="button" data-oruga="button"><span class="o-btn__wrapper"><!----><span class="o-btn__label">Refresh profile</span>
|
||||
<!----></span>
|
||||
</button>
|
||||
</div>
|
||||
<section>
|
||||
<h2>1 members</h2>
|
||||
<div class="o-table__root" data-oruga="table">
|
||||
<div style="display: none;"><span data-id="1" data-oruga="table-column">Member <!----></span><span data-id="2" data-oruga="table-column">Role <!----></span><span data-id="3" data-oruga="table-column">Date <!----></span></div>
|
||||
<!---->
|
||||
<!---->
|
||||
<div class="o-table__wrapper">
|
||||
<table class="o-table">
|
||||
<!---->
|
||||
<thead>
|
||||
<tr>
|
||||
<!---->
|
||||
<!---->
|
||||
<th class="o-table__th" draggable="false"><span>Member <span class="o-table__th__sort-icon" style="display: none;"><span class="o-icon o-icon--small" data-oruga="icon"><i class="mdi mdi-arrow-up"></i></span></span></span></th>
|
||||
<th class="o-table__th" draggable="false"><span>Role <span class="o-table__th__sort-icon" style="display: none;"><span class="o-icon o-icon--small" data-oruga="icon"><i class="mdi mdi-arrow-up"></i></span></span></span></th>
|
||||
<th class="o-table__th" draggable="false"><span>Date <span class="o-table__th__sort-icon" style="display: none;"><span class="o-icon o-icon--small" data-oruga="icon"><i class="mdi mdi-arrow-up"></i></span></span></span></th>
|
||||
<!---->
|
||||
</tr>
|
||||
<!---->
|
||||
<!---->
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr class="" draggable="false">
|
||||
<!---->
|
||||
<!---->
|
||||
<td class="o-table__td" data-label="Member">
|
||||
<article class="flex gap-1">
|
||||
<div class="flex-none"><a href="/settings/admin/profiles/6548012" class="no-underline"><span aria-hidden="true" class="material-design-icon account-circle-icon" role="img"><svg fill="currentColor" class="material-design-icon__svg" width="48" height="48" viewBox="0 0 24 24"><path d="M12,19.2C9.5,19.2 7.29,17.92 6,16C6.03,14 10,12.9 12,12.9C14,12.9 17.97,14 18,16C16.71,17.92 14.5,19.2 12,19.2M12,5A3,3 0 0,1 15,8A3,3 0 0,1 12,11A3,3 0 0,1 9,8A3,3 0 0,1 12,5M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12C22,6.47 17.5,2 12,2Z"><!--v-if--></path></svg></span></a></div>
|
||||
<div>
|
||||
<div class="prose dark:prose-invert"><a href="/settings/admin/profiles/6548012" class="no-underline">member #1</a><br><a href="/settings/admin/profiles/6548012" class="no-underline">@member_1</a></div>
|
||||
</div>
|
||||
</article>
|
||||
</td>
|
||||
<td class="o-table__td" data-label="Role"><span data-v-6955ca87="" class="rounded-md truncate text-sm text-black px-2 py-1 bg-purple-3 dark:text-violet-3">Administrator</span></td>
|
||||
<td class="o-table__td" data-label="Date"><span class="has-text-centered">Sunday, June 13, 2021<br>9:24 AM</span></td>
|
||||
<!---->
|
||||
</tr>
|
||||
<transition-stub name="slide" appear="false" persisted="false" css="true">
|
||||
<!---->
|
||||
</transition-stub>
|
||||
<!---->
|
||||
<!---->
|
||||
</tbody>
|
||||
<!---->
|
||||
</table>
|
||||
<transition-stub name="fade" appear="false" persisted="false" css="true">
|
||||
<!---->
|
||||
</transition-stub>
|
||||
</div>
|
||||
<div class="o-table__pagination" per-page="10" total="1" rounded="false" size="small" simple="false" aria-next-label="Next page" aria-previous-label="Previous page" aria-page-label="Page" aria-current-label="Current page">
|
||||
<div></div>
|
||||
<div>
|
||||
<nav class="o-pag o-pag--right o-pag--small" data-oruga="pagination"><button role="button" tabindex="0" class="o-pag__link o-pag__previous o-pag__link--disabled" aria-label="Previous page" aria-current="false"><span class="o-icon" data-oruga="icon" aria-hidden="true"><i class="mdi mdi-chevron-left mdi-24px"></i></span></button><button role="button" tabindex="0" class="o-pag__link o-pag__next o-pag__link--disabled" aria-label="Next page" aria-current="false"><span class="o-icon" data-oruga="icon" aria-hidden="true"><i class="mdi mdi-chevron-right mdi-24px"></i></span></button>
|
||||
<ul class="o-pag__list">
|
||||
<!---->
|
||||
<!---->
|
||||
<li class="o-pag__item"><button role="button" tabindex="0" class="o-pag__link o-pag__link--current" aria-label="Current page, Page 1." aria-current="true">1</button></li>
|
||||
<!---->
|
||||
<!---->
|
||||
</ul>
|
||||
</nav>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
<section>
|
||||
<h2>30410 organized events</h2>
|
||||
<div class="o-table__root" data-oruga="table">
|
||||
<div style="display: none;"><span data-id="1" data-oruga="table-column">Title <!----></span><span data-id="2" data-oruga="table-column">Begins on <!----></span></div>
|
||||
<!---->
|
||||
<!---->
|
||||
<div class="o-table__wrapper">
|
||||
<table class="o-table o-table--table__empty">
|
||||
<!---->
|
||||
<thead>
|
||||
<tr>
|
||||
<!---->
|
||||
<!---->
|
||||
<th class="o-table__th" draggable="false"><span>Title <span class="o-table__th__sort-icon" style="display: none;"><span class="o-icon o-icon--small" data-oruga="icon"><i class="mdi mdi-arrow-up"></i></span></span></span></th>
|
||||
<th class="o-table__th" draggable="false"><span>Begins on <span class="o-table__th__sort-icon" style="display: none;"><span class="o-icon o-icon--small" data-oruga="icon"><i class="mdi mdi-arrow-up"></i></span></span></span></th>
|
||||
<!---->
|
||||
</tr>
|
||||
<!---->
|
||||
<!---->
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td colspan="2">
|
||||
<div class="flex flex-col items-center mt-20 mb-10" role="note"><span class="o-icon" data-oruga="icon"><i class="mdi mdi-account-group 48"></i></span>
|
||||
<h2 class="mb-3">
|
||||
<!-- @slot Mandatory title -->No organized events found
|
||||
</h2>
|
||||
<p class="" style="display: none;">
|
||||
<!-- @slot Optional description -->
|
||||
</p>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
<!---->
|
||||
</table>
|
||||
<transition-stub name="fade" appear="false" persisted="false" css="true">
|
||||
<!---->
|
||||
</transition-stub>
|
||||
</div>
|
||||
<div class="o-table__pagination" per-page="10" total="30410" rounded="false" size="small" simple="false" aria-next-label="Next page" aria-previous-label="Previous page" aria-page-label="Page" aria-current-label="Current page">
|
||||
<div></div>
|
||||
<div>
|
||||
<nav class="o-pag o-pag--right o-pag--small" data-oruga="pagination"><button role="button" tabindex="0" class="o-pag__link o-pag__previous o-pag__link--disabled" aria-label="Previous page" aria-current="false"><span class="o-icon" data-oruga="icon" aria-hidden="true"><i class="mdi mdi-chevron-left mdi-24px"></i></span></button><button role="button" tabindex="0" class="o-pag__link o-pag__next" aria-label="Next page" aria-current="false"><span class="o-icon" data-oruga="icon" aria-hidden="true"><i class="mdi mdi-chevron-right mdi-24px"></i></span></button>
|
||||
<ul class="o-pag__list">
|
||||
<!---->
|
||||
<!---->
|
||||
<li class="o-pag__item"><button role="button" tabindex="0" class="o-pag__link o-pag__link--current" aria-label="Current page, Page 1." aria-current="true">1</button></li>
|
||||
<li class="o-pag__item"><button role="button" tabindex="0" class="o-pag__link" aria-label="Page 2." aria-current="false">2</button></li>
|
||||
<li class="o-pag__item"><span class="o-pag__ellipsis">…</span></li>
|
||||
<li class="o-pag__item"><button role="button" tabindex="0" class="o-pag__link" aria-label="Page 3041." aria-current="false">3041</button></li>
|
||||
</ul>
|
||||
</nav>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
<section>
|
||||
<h2>0 posts</h2>
|
||||
<div class="o-table__root" data-oruga="table">
|
||||
<div style="display: none;"><span data-id="1" data-oruga="table-column">Title <!----></span><span data-id="2" data-oruga="table-column">Publication date <!----></span></div>
|
||||
<!---->
|
||||
<!---->
|
||||
<div class="o-table__wrapper">
|
||||
<table class="o-table o-table--table__empty">
|
||||
<!---->
|
||||
<thead>
|
||||
<tr>
|
||||
<!---->
|
||||
<!---->
|
||||
<th class="o-table__th" draggable="false"><span>Title <span class="o-table__th__sort-icon" style="display: none;"><span class="o-icon o-icon--small" data-oruga="icon"><i class="mdi mdi-arrow-up"></i></span></span></span></th>
|
||||
<th class="o-table__th" draggable="false"><span>Publication date <span class="o-table__th__sort-icon" style="display: none;"><span class="o-icon o-icon--small" data-oruga="icon"><i class="mdi mdi-arrow-up"></i></span></span></span></th>
|
||||
<!---->
|
||||
</tr>
|
||||
<!---->
|
||||
<!---->
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td colspan="2">
|
||||
<div class="flex flex-col items-center mt-20 mb-10" role="note"><span class="o-icon" data-oruga="icon"><i class="mdi mdi-bullhorn 48"></i></span>
|
||||
<h2 class="mb-3">
|
||||
<!-- @slot Mandatory title -->No posts found
|
||||
</h2>
|
||||
<p class="" style="display: none;">
|
||||
<!-- @slot Optional description -->
|
||||
</p>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
<!---->
|
||||
</table>
|
||||
<transition-stub name="fade" appear="false" persisted="false" css="true">
|
||||
<!---->
|
||||
</transition-stub>
|
||||
</div>
|
||||
<div class="o-table__pagination" per-page="10" total="0" rounded="false" size="small" simple="false" aria-next-label="Next page" aria-previous-label="Previous page" aria-page-label="Page" aria-current-label="Current page">
|
||||
<div></div>
|
||||
<div>
|
||||
<nav class="o-pag o-pag--right o-pag--small" data-oruga="pagination"><button role="button" tabindex="0" class="o-pag__link o-pag__previous o-pag__link--disabled" aria-label="Previous page" aria-current="false"><span class="o-icon" data-oruga="icon" aria-hidden="true"><i class="mdi mdi-chevron-left mdi-24px"></i></span></button><button role="button" tabindex="0" class="o-pag__link o-pag__next o-pag__link--disabled" aria-label="Next page" aria-current="false"><span class="o-icon" data-oruga="icon" aria-hidden="true"><i class="mdi mdi-chevron-right mdi-24px"></i></span></button>
|
||||
<ul class="o-pag__list">
|
||||
<!---->
|
||||
<!---->
|
||||
<!---->
|
||||
<!---->
|
||||
</ul>
|
||||
</nav>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>"
|
||||
`;
|
||||
@@ -1,258 +0,0 @@
|
||||
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
|
||||
|
||||
exports[`AdminProfile > Show simple 1`] = `
|
||||
"<div class="section">
|
||||
<breadcrumbs-nav links="[object Object],[object Object],[object Object]"></breadcrumbs-nav>
|
||||
<div class="flex justify-center">
|
||||
<div data-v-b0ff4ece="" class="bg-white dark:bg-mbz-purple rounded-lg flex space-x-4 items-center flex-col p-4 shadow-md sm:p-8 pb-10 w-80">
|
||||
<div data-v-b0ff4ece="" class="flex pl-2"><span data-v-b0ff4ece="" class="ltr:-mr-0.5 rtl:-ml-0.5 material-design-icon account-circle-icon ltr:-mr-0.5 rtl:-ml-0.5" aria-hidden="true" role="img"><svg fill="currentColor" class="material-design-icon__svg" width="48" height="48" viewBox="0 0 24 24"><path d="M12,19.2C9.5,19.2 7.29,17.92 6,16C6.03,14 10,12.9 12,12.9C14,12.9 17.97,14 18,16C16.71,17.92 14.5,19.2 12,19.2M12,5A3,3 0 0,1 15,8A3,3 0 0,1 12,11A3,3 0 0,1 9,8A3,3 0 0,1 12,5M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12C22,6.47 17.5,2 12,2Z"><!--v-if--></path></svg></span></div>
|
||||
<div data-v-b0ff4ece="" class="text-center overflow-hidden w-full">
|
||||
<h5 data-v-b0ff4ece="" class="text-xl font-medium violet-title tracking-tight text-gray-900 dark:text-gray-200 whitespace-pre-line line-clamp-2">CurrentPerson</h5>
|
||||
<p data-v-b0ff4ece="" class="text-gray-500 dark:text-gray-200 truncate"><span data-v-b0ff4ece="" dir="ltr">@current</span></p>
|
||||
<!--v-if-->
|
||||
<div data-v-b0ff4ece="" class="only-first-child line-clamp-10"></div>
|
||||
</div>
|
||||
<div data-v-b0ff4ece="" class="flex pr-2"><a data-v-b0ff4ece="" href="/conversations?newMessage=true&personMentions=current" class=""><span data-v-b0ff4ece="" aria-hidden="true" class="material-design-icon email-icon" role="img"><svg fill="currentColor" class="material-design-icon__svg" width="24" height="24" viewBox="0 0 24 24"><path d="M20,8L12,13L4,8V6L12,11L20,6M20,4H4C2.89,4 2,4.89 2,6V18A2,2 0 0,0 4,20H20A2,2 0 0,0 22,18V6C22,4.89 21.1,4 20,4Z"><!--v-if--></path></svg></span></a></div>
|
||||
</div>
|
||||
<!-- <div
|
||||
class="p-4 bg-white rounded-lg shadow-md sm:p-8 flex items-center space-x-4"
|
||||
dir="auto"
|
||||
>
|
||||
<div class="flex-shrink-0">
|
||||
<figure class="w-12 h-12" v-if="actor.avatar">
|
||||
<img
|
||||
class="rounded-lg"
|
||||
:src="actor.avatar.url"
|
||||
alt=""
|
||||
width="48"
|
||||
height="48"
|
||||
/>
|
||||
</figure>
|
||||
<o-icon
|
||||
v-else
|
||||
size="large"
|
||||
icon="account-circle"
|
||||
class="ltr:-mr-0.5 rtl:-ml-0.5"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div class="flex-1 min-w-0">
|
||||
<h5 class="text-xl font-medium violet-title tracking-tight text-gray-900">
|
||||
{{ displayName(actor) }}
|
||||
</h5>
|
||||
<p class="text-gray-500 truncate" v-if="actor.name">
|
||||
<span dir="ltr">@{{ usernameWithDomain(actor) }}</span>
|
||||
</p>
|
||||
<div
|
||||
v-if="full"
|
||||
class="line-clamp-3"
|
||||
:class="{ limit: limit }"
|
||||
v-html="actor.summary"
|
||||
/>
|
||||
</div>
|
||||
</div> -->
|
||||
</div>
|
||||
<section class="mt-4 mb-3">
|
||||
<h2 class="">Details</h2>
|
||||
<div class="flex flex-col">
|
||||
<div class="overflow-x-auto sm:-mx-6 lg:-mx-8">
|
||||
<div class="inline-block py-2 min-w-full sm:px-2 lg:px-8">
|
||||
<div class="overflow-hidden shadow-md sm:rounded-lg">
|
||||
<table class="min-w-full">
|
||||
<tbody>
|
||||
<tr class="odd:bg-white dark:odd:bg-zinc-800 even:bg-gray-50 dark:even:bg-zinc-700 border-b">
|
||||
<td class="py-4 px-2 whitespace-nowrap">Status</td>
|
||||
<td class="py-4 px-2 text-sm text-gray-500 dark:text-gray-200 whitespace-nowrap">Active</td>
|
||||
</tr>
|
||||
<tr class="odd:bg-white dark:odd:bg-zinc-800 even:bg-gray-50 dark:even:bg-zinc-700 border-b">
|
||||
<td class="py-4 px-2 whitespace-nowrap">Domain</td>
|
||||
<td class="py-4 px-2 text-sm text-gray-500 dark:text-gray-200 whitespace-nowrap">Local</td>
|
||||
</tr>
|
||||
<tr class="odd:bg-white dark:odd:bg-zinc-800 even:bg-gray-50 dark:even:bg-zinc-700 border-b">
|
||||
<td class="py-4 px-2 whitespace-nowrap">Uploaded media size</td>
|
||||
<td class="py-4 px-2 text-sm text-gray-500 dark:text-gray-200 whitespace-nowrap">0 octet</td>
|
||||
</tr>
|
||||
<tr class="odd:bg-white dark:odd:bg-zinc-800 even:bg-gray-50 dark:even:bg-zinc-700 border-b">
|
||||
<td class="py-4 px-2 whitespace-nowrap">User</td>
|
||||
<td class="py-4 px-2 text-sm text-gray-500 dark:text-gray-200 whitespace-nowrap"><a href="/settings/admin/users/1" class="">current@mobilizon.test</a></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
<section class="mt-4 mb-3">
|
||||
<h2 class="">Actions</h2>
|
||||
<p></p>
|
||||
<div class="p-4 mb-4 text-sm text-blue-700 bg-blue-100 rounded-lg" role="alert">This profile is located on this instance, so you need to <a href="/settings/admin/users/1" class="underline">access the corresponding account</a> to ban it.</div>
|
||||
</section>
|
||||
<section class="mt-4 mb-3">
|
||||
<h2 class="">Organized events</h2>
|
||||
<div class="o-table__root" data-oruga="table">
|
||||
<div style="display: none;"><span data-id="1" data-oruga="table-column">Begins on <!----></span><span data-id="2" data-oruga="table-column">Title <!----></span></div>
|
||||
<!---->
|
||||
<!---->
|
||||
<div class="o-table__wrapper">
|
||||
<table class="o-table o-table--table__empty">
|
||||
<!---->
|
||||
<thead>
|
||||
<tr>
|
||||
<!---->
|
||||
<!---->
|
||||
<th class="o-table__th" draggable="false"><span>Begins on <span class="o-table__th__sort-icon" style="display: none;"><span class="o-icon o-icon--small" data-oruga="icon"><i class="mdi mdi-arrow-up"></i></span></span></span></th>
|
||||
<th class="o-table__th" draggable="false"><span>Title <span class="o-table__th__sort-icon" style="display: none;"><span class="o-icon o-icon--small" data-oruga="icon"><i class="mdi mdi-arrow-up"></i></span></span></span></th>
|
||||
<!---->
|
||||
</tr>
|
||||
<!---->
|
||||
<!---->
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td colspan="2">
|
||||
<div class="flex flex-col items-center mt-20 mb-10" role="note"><span class="o-icon" data-oruga="icon"><i class="mdi mdi-account-group 48"></i></span>
|
||||
<h2 class="mb-3">
|
||||
<!-- @slot Mandatory title -->No organized events listed
|
||||
</h2>
|
||||
<p class="" style="display: none;">
|
||||
<!-- @slot Optional description -->
|
||||
</p>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
<!---->
|
||||
</table>
|
||||
<transition-stub name="fade" appear="false" persisted="false" css="true">
|
||||
<!---->
|
||||
</transition-stub>
|
||||
</div>
|
||||
<div class="o-table__pagination" per-page="10" total="0" rounded="false" size="small" simple="false" aria-next-label="Next page" aria-previous-label="Previous page" aria-page-label="Page" aria-current-label="Current page">
|
||||
<div></div>
|
||||
<div>
|
||||
<nav class="o-pag o-pag--right o-pag--small" data-oruga="pagination"><button role="button" tabindex="0" class="o-pag__link o-pag__previous o-pag__link--disabled" aria-label="Previous page" aria-current="false"><span class="o-icon" data-oruga="icon" aria-hidden="true"><i class="mdi mdi-chevron-left mdi-24px"></i></span></button><button role="button" tabindex="0" class="o-pag__link o-pag__next o-pag__link--disabled" aria-label="Next page" aria-current="false"><span class="o-icon" data-oruga="icon" aria-hidden="true"><i class="mdi mdi-chevron-right mdi-24px"></i></span></button>
|
||||
<ul class="o-pag__list">
|
||||
<!---->
|
||||
<!---->
|
||||
<!---->
|
||||
<!---->
|
||||
</ul>
|
||||
</nav>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
<section class="mt-4 mb-3">
|
||||
<h2 class="">Participations</h2>
|
||||
<div class="o-table__root" data-oruga="table">
|
||||
<div style="display: none;"><span data-id="1" data-oruga="table-column">Begins on <!----></span><span data-id="2" data-oruga="table-column">Title <!----></span></div>
|
||||
<!---->
|
||||
<!---->
|
||||
<div class="o-table__wrapper">
|
||||
<table class="o-table o-table--table__empty">
|
||||
<!---->
|
||||
<thead>
|
||||
<tr>
|
||||
<!---->
|
||||
<!---->
|
||||
<th class="o-table__th" draggable="false"><span>Begins on <span class="o-table__th__sort-icon" style="display: none;"><span class="o-icon o-icon--small" data-oruga="icon"><i class="mdi mdi-arrow-up"></i></span></span></span></th>
|
||||
<th class="o-table__th" draggable="false"><span>Title <span class="o-table__th__sort-icon" style="display: none;"><span class="o-icon o-icon--small" data-oruga="icon"><i class="mdi mdi-arrow-up"></i></span></span></span></th>
|
||||
<!---->
|
||||
</tr>
|
||||
<!---->
|
||||
<!---->
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td colspan="2">
|
||||
<div class="flex flex-col items-center mt-20 mb-10" role="note"><span class="o-icon" data-oruga="icon"><i class="mdi mdi-account-group 48"></i></span>
|
||||
<h2 class="mb-3">
|
||||
<!-- @slot Mandatory title -->No participations listed
|
||||
</h2>
|
||||
<p class="" style="display: none;">
|
||||
<!-- @slot Optional description -->
|
||||
</p>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
<!---->
|
||||
</table>
|
||||
<transition-stub name="fade" appear="false" persisted="false" css="true">
|
||||
<!---->
|
||||
</transition-stub>
|
||||
</div>
|
||||
<div class="o-table__pagination" per-page="10" total="0" rounded="false" size="small" simple="false" aria-next-label="Next page" aria-previous-label="Previous page" aria-page-label="Page" aria-current-label="Current page">
|
||||
<div></div>
|
||||
<div>
|
||||
<nav class="o-pag o-pag--right o-pag--small" data-oruga="pagination"><button role="button" tabindex="0" class="o-pag__link o-pag__previous o-pag__link--disabled" aria-label="Previous page" aria-current="false"><span class="o-icon" data-oruga="icon" aria-hidden="true"><i class="mdi mdi-chevron-left mdi-24px"></i></span></button><button role="button" tabindex="0" class="o-pag__link o-pag__next o-pag__link--disabled" aria-label="Next page" aria-current="false"><span class="o-icon" data-oruga="icon" aria-hidden="true"><i class="mdi mdi-chevron-right mdi-24px"></i></span></button>
|
||||
<ul class="o-pag__list">
|
||||
<!---->
|
||||
<!---->
|
||||
<!---->
|
||||
<!---->
|
||||
</ul>
|
||||
</nav>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
<section class="mt-4 mb-3">
|
||||
<h2 class="">Memberships</h2>
|
||||
<div class="o-table__root" data-oruga="table">
|
||||
<div style="display: none;"><span data-id="1" data-oruga="table-column">Group <!----></span><span data-id="2" data-oruga="table-column">Role <!----></span><span data-id="3" data-oruga="table-column">Date <!----></span></div>
|
||||
<!---->
|
||||
<!---->
|
||||
<div class="o-table__wrapper">
|
||||
<table class="o-table o-table--table__empty">
|
||||
<!---->
|
||||
<thead>
|
||||
<tr>
|
||||
<!---->
|
||||
<!---->
|
||||
<th class="o-table__th" draggable="false"><span>Group <span class="o-table__th__sort-icon" style="display: none;"><span class="o-icon o-icon--small" data-oruga="icon"><i class="mdi mdi-arrow-up"></i></span></span></span></th>
|
||||
<th class="o-table__th" draggable="false"><span>Role <span class="o-table__th__sort-icon" style="display: none;"><span class="o-icon o-icon--small" data-oruga="icon"><i class="mdi mdi-arrow-up"></i></span></span></span></th>
|
||||
<th class="o-table__th" draggable="false"><span>Date <span class="o-table__th__sort-icon" style="display: none;"><span class="o-icon o-icon--small" data-oruga="icon"><i class="mdi mdi-arrow-up"></i></span></span></span></th>
|
||||
<!---->
|
||||
</tr>
|
||||
<!---->
|
||||
<!---->
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td colspan="3">
|
||||
<div class="flex flex-col items-center mt-20 mb-10" role="note"><span class="o-icon" data-oruga="icon"><i class="mdi mdi-account-group 48"></i></span>
|
||||
<h2 class="mb-3">
|
||||
<!-- @slot Mandatory title -->No memberships found
|
||||
</h2>
|
||||
<p class="" style="display: none;">
|
||||
<!-- @slot Optional description -->
|
||||
</p>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
<!---->
|
||||
</table>
|
||||
<transition-stub name="fade" appear="false" persisted="false" css="true">
|
||||
<!---->
|
||||
</transition-stub>
|
||||
</div>
|
||||
<div class="o-table__pagination" per-page="10" total="0" rounded="false" size="small" simple="false" aria-next-label="Next page" aria-previous-label="Previous page" aria-page-label="Page" aria-current-label="Current page">
|
||||
<div></div>
|
||||
<div>
|
||||
<nav class="o-pag o-pag--right o-pag--small" data-oruga="pagination"><button role="button" tabindex="0" class="o-pag__link o-pag__previous o-pag__link--disabled" aria-label="Previous page" aria-current="false"><span class="o-icon" data-oruga="icon" aria-hidden="true"><i class="mdi mdi-chevron-left mdi-24px"></i></span></button><button role="button" tabindex="0" class="o-pag__link o-pag__next o-pag__link--disabled" aria-label="Next page" aria-current="false"><span class="o-icon" data-oruga="icon" aria-hidden="true"><i class="mdi mdi-chevron-right mdi-24px"></i></span></button>
|
||||
<ul class="o-pag__list">
|
||||
<!---->
|
||||
<!---->
|
||||
<!---->
|
||||
<!---->
|
||||
</ul>
|
||||
</nav>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>"
|
||||
`;
|
||||
@@ -1,798 +0,0 @@
|
||||
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
|
||||
|
||||
exports[`UsersView > Ban user 1`] = `
|
||||
"<div>
|
||||
<breadcrumbs-nav links="[object Object],[object Object],[object Object]"></breadcrumbs-nav>
|
||||
<section>
|
||||
<h2 class="text-lg font-bold mb-3">Details</h2>
|
||||
<div class="flex flex-col">
|
||||
<div class="overflow-x-auto">
|
||||
<div class="inline-block py-2 min-w-full sm:px-2">
|
||||
<div class="overflow-hidden shadow-md sm:rounded-lg">
|
||||
<table class="table w-full">
|
||||
<tbody>
|
||||
<tr class="border-b">
|
||||
<td class="py-4 px-2 whitespace-nowrap align-middle">Email</td>
|
||||
<td class="py-4 px-2 align-middle">truc@mobilizon.test</td>
|
||||
<td class="py-4 px-2 whitespace-nowrap flex flex flex-col items-start gap-2"><button type="button" class="o-btn o-btn--small o-btn--text" role="button" data-oruga="button"><span class="o-btn__wrapper"><span class="o-icon o-icon--small o-btn__icon o-btn__icon-left" data-oruga="icon"><i class="mdi mdi-pencil"></i></span><span class="o-btn__label">Change email</span>
|
||||
<!----></span>
|
||||
</button>
|
||||
<router-link-stub class="o-btn o-btn--small o-btn--text" role="button" data-oruga="button" to="[object Object]"></router-link-stub>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="border-b">
|
||||
<td class="py-4 px-2 whitespace-nowrap align-middle">Language</td>
|
||||
<td class="py-4 px-2 align-middle">French</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr class="border-b">
|
||||
<td class="py-4 px-2 whitespace-nowrap align-middle">Role</td>
|
||||
<td class="py-4 px-2 whitespace-nowrap"><span class="bg-blue-100 text-blue-800 text-sm font-medium mr-2 px-2.5 py-0.5 rounded">User</span></td>
|
||||
<td class="py-4 px-2 whitespace-nowrap flex items-center"><button type="button" class="o-btn o-btn--small o-btn--text" role="button" data-oruga="button"><span class="o-btn__wrapper"><span class="o-icon o-icon--small o-btn__icon o-btn__icon-left" data-oruga="icon"><i class="mdi mdi-chevron-double-up"></i></span><span class="o-btn__label">Change role</span>
|
||||
<!----></span>
|
||||
</button></td>
|
||||
</tr>
|
||||
<tr class="border-b">
|
||||
<td class="py-4 px-2 whitespace-nowrap align-middle">Login status</td>
|
||||
<td class="py-4 px-2 align-middle">Activated</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr class="border-b">
|
||||
<td class="py-4 px-2 whitespace-nowrap align-middle">Confirmed</td>
|
||||
<td class="py-4 px-2 align-middle">Saturday, August 30, 2025 at 11:56 AM</td>
|
||||
<td class="py-4 px-2 whitespace-nowrap flex items-center">
|
||||
<!--v-if-->
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="border-b">
|
||||
<td class="py-4 px-2 whitespace-nowrap align-middle">Last sign-in</td>
|
||||
<td class="py-4 px-2 align-middle">Unknown</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr class="border-b">
|
||||
<td class="py-4 px-2 whitespace-nowrap align-middle">Last IP adress</td>
|
||||
<td class="py-4 px-2 align-middle">Unknown</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr class="border-b">
|
||||
<td class="py-4 px-2 whitespace-nowrap align-middle">Total number of participations</td>
|
||||
<td class="py-4 px-2 align-middle">14</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr class="border-b">
|
||||
<td class="py-4 px-2 whitespace-nowrap align-middle">Uploaded media total size</td>
|
||||
<td class="py-4 px-2 align-middle">6,76 mégaoctets</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
<section class="my-4">
|
||||
<h2 class="text-lg font-bold mb-3">Profiles</h2>
|
||||
<div class="flex flex-wrap justify-center sm:justify-start gap-4">
|
||||
<router-link-stub to="[object Object]" replace="false" custom="false" ariacurrentvalue="page" viewtransition="false"></router-link-stub>
|
||||
</div>
|
||||
</section>
|
||||
<section class="my-4">
|
||||
<h2 class="text-lg font-bold mb-3">Actions</h2>
|
||||
<table>
|
||||
<tr>
|
||||
<!--v-if-->
|
||||
<td>
|
||||
<div class="buttons"><button type="button" class="o-btn o-btn--danger" role="button" data-oruga="button" id="deleteAccount"><span class="o-btn__wrapper"><!----><span class="o-btn__label">Ban</span>
|
||||
<!----></span>
|
||||
</button></div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</section>
|
||||
<!--teleport start-->
|
||||
<transition-stub name="zoom-out" appear="false" persisted="false" css="true">
|
||||
<div close-button-aria-label="Close" aria-modal="false" data-oruga="modal" class="o-modal" tabindex="-1" role="dialog" aria-label="Edit user email" style="display: none;">
|
||||
<div class="o-modal__overlay" tabindex="-1" aria-hidden="true"></div>
|
||||
<div class="o-modal__content" style="max-width: 960px;">
|
||||
<form>
|
||||
<div class="" style="width: auto;">
|
||||
<header class="">
|
||||
<h2>Change user email</h2>
|
||||
</header>
|
||||
<section class="">
|
||||
<div data-oruga="field" class="o-field o-field--filled"><label class="o-field__label" for="">Previous email</label>
|
||||
<div class="o-field__body">
|
||||
<div class="o-field o-field--addons">
|
||||
<div data-oruga="input" class="o-input__wrapper"><input id="" data-oruga-input="email" type="email" class="o-input o-input--disabled" autocomplete="off" disabled="">
|
||||
<!---->
|
||||
<!---->
|
||||
<!---->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!---->
|
||||
</div>
|
||||
<div data-oruga="field" class="o-field"><label class="o-field__label" for="">New email</label>
|
||||
<div class="o-field__body">
|
||||
<div class="o-field o-field--addons">
|
||||
<div data-oruga="input" class="o-input__wrapper"><input required="" id="" data-oruga-input="email" type="email" class="o-input" autocomplete="off" placeholder="new@email.com">
|
||||
<!---->
|
||||
<!---->
|
||||
<!---->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!---->
|
||||
</div><label class="o-chk o-chk--checked" data-oruga="checkbox" role="checkbox" aria-checked="true"><input type="checkbox" data-oruga-input="checkbox" class="o-chk__input o-chk__input--checked" autocomplete="off" true-value="true" false-value="false"><span class="o-chk__label">Notify the user of the change</span></label>
|
||||
</section>
|
||||
<footer class="mt-2 flex gap-2"><button type="button" class="o-btn o-btn--outlined" role="button" data-oruga="button"><span class="o-btn__wrapper"><!----><span class="o-btn__label">Close</span>
|
||||
<!----></span>
|
||||
</button><button type="submit" class="o-btn o-btn--primary" role="button" data-oruga="button"><span class="o-btn__wrapper"><!----><span class="o-btn__label">Change email</span>
|
||||
<!----></span>
|
||||
</button></footer>
|
||||
</div>
|
||||
</form><span class="o-icon o-icon--clickable o-icon--medium o-modal__close" data-oruga="icon" style="display: none;"><i class="mdi mdi-close mdi-36px"></i></span>
|
||||
</div>
|
||||
</div>
|
||||
</transition-stub>
|
||||
<!--teleport end-->
|
||||
<!--teleport start-->
|
||||
<transition-stub name="zoom-out" appear="false" persisted="false" css="true">
|
||||
<div has-modal-card="" close-button-aria-label="Close" aria-modal="false" data-oruga="modal" class="o-modal" tabindex="-1" role="dialog" aria-label="Edit user email" style="display: none;">
|
||||
<div class="o-modal__overlay" tabindex="-1" aria-hidden="true"></div>
|
||||
<div class="o-modal__content" style="max-width: 960px;">
|
||||
<form>
|
||||
<header>
|
||||
<h2>Change user role</h2>
|
||||
</header>
|
||||
<section>
|
||||
<div data-oruga="field" class="o-field">
|
||||
<!---->
|
||||
<div class="o-field__body">
|
||||
<div class="o-field o-field--addons"><label class="o-radio" data-oruga="radio" role="radio" aria-checked="false"><input type="radio" data-oruga-input="radio" class="o-radio__input" autocomplete="off" value="ADMINISTRATOR"><span class="o-radio__label">Administrator</span></label></div>
|
||||
</div>
|
||||
<!---->
|
||||
</div>
|
||||
<div data-oruga="field" class="o-field">
|
||||
<!---->
|
||||
<div class="o-field__body">
|
||||
<div class="o-field o-field--addons"><label class="o-radio" data-oruga="radio" role="radio" aria-checked="false"><input type="radio" data-oruga-input="radio" class="o-radio__input" autocomplete="off" value="MODERATOR"><span class="o-radio__label">Moderator</span></label></div>
|
||||
</div>
|
||||
<!---->
|
||||
</div>
|
||||
<div data-oruga="field" class="o-field">
|
||||
<!---->
|
||||
<div class="o-field__body">
|
||||
<div class="o-field o-field--addons"><label class="o-radio o-radio--checked" data-oruga="radio" role="radio" aria-checked="true"><input type="radio" data-oruga-input="radio" class="o-radio__input o-radio__input--checked" autocomplete="off" value="USER"><span class="o-radio__label">User</span></label></div>
|
||||
</div>
|
||||
<!---->
|
||||
</div><label class="o-chk o-chk--checked" data-oruga="checkbox" role="checkbox" aria-checked="true"><input type="checkbox" data-oruga-input="checkbox" class="o-chk__input o-chk__input--checked" autocomplete="off" true-value="true" false-value="false"><span class="o-chk__label">Notify the user of the change</span></label>
|
||||
</section>
|
||||
<footer class="mt-2 flex gap-2"><button type="button" class="o-btn o-btn--outlined" role="button" data-oruga="button"><span class="o-btn__wrapper"><!----><span class="o-btn__label">Close</span>
|
||||
<!----></span>
|
||||
</button><button type="submit" class="o-btn o-btn--primary" role="button" data-oruga="button"><span class="o-btn__wrapper"><!----><span class="o-btn__label">Change role</span>
|
||||
<!----></span>
|
||||
</button></footer>
|
||||
</form><span class="o-icon o-icon--clickable o-icon--medium o-modal__close" data-oruga="icon" style="display: none;"><i class="mdi mdi-close mdi-36px"></i></span>
|
||||
</div>
|
||||
</div>
|
||||
</transition-stub>
|
||||
<!--teleport end-->
|
||||
<!--teleport start-->
|
||||
<transition-stub name="zoom-out" appear="false" persisted="false" css="true">
|
||||
<div has-modal-card="" close-button-aria-label="Close" aria-modal="false" data-oruga="modal" class="o-modal" tabindex="-1" role="dialog" aria-label="Edit user email" style="display: none;">
|
||||
<div class="o-modal__overlay" tabindex="-1" aria-hidden="true"></div>
|
||||
<div class="o-modal__content" style="max-width: 960px;">
|
||||
<form>
|
||||
<header>
|
||||
<h2>Confirm user</h2>
|
||||
</header>
|
||||
<section><label class="o-chk o-chk--checked" data-oruga="checkbox" role="checkbox" aria-checked="true"><input type="checkbox" data-oruga-input="checkbox" class="o-chk__input o-chk__input--checked" autocomplete="off" true-value="true" false-value="false"><span class="o-chk__label">Notify the user of the change</span></label></section>
|
||||
<footer><button type="button" class="o-btn" role="button" data-oruga="button"><span class="o-btn__wrapper"><!----><span class="o-btn__label">Close</span>
|
||||
<!----></span>
|
||||
</button><button type="submit" class="o-btn o-btn--primary" role="button" data-oruga="button"><span class="o-btn__wrapper"><!----><span class="o-btn__label">Confirm user</span>
|
||||
<!----></span>
|
||||
</button></footer>
|
||||
</form><span class="o-icon o-icon--clickable o-icon--medium o-modal__close" data-oruga="icon" style="display: none;"><i class="mdi mdi-close mdi-36px"></i></span>
|
||||
</div>
|
||||
</div>
|
||||
</transition-stub>
|
||||
<!--teleport end-->
|
||||
</div>"
|
||||
`;
|
||||
|
||||
exports[`UsersView > Show moderate list 1`] = `
|
||||
"<div>
|
||||
<breadcrumbs-nav links="[object Object],[object Object],[object Object]"></breadcrumbs-nav>
|
||||
<section>
|
||||
<h2 class="text-lg font-bold mb-3">Details</h2>
|
||||
<div class="flex flex-col">
|
||||
<div class="overflow-x-auto">
|
||||
<div class="inline-block py-2 min-w-full sm:px-2">
|
||||
<div class="overflow-hidden shadow-md sm:rounded-lg">
|
||||
<table class="table w-full">
|
||||
<tbody>
|
||||
<tr class="border-b">
|
||||
<td class="py-4 px-2 whitespace-nowrap align-middle">Email</td>
|
||||
<td class="py-4 px-2 align-middle">truc@mobilizon.test</td>
|
||||
<td class="py-4 px-2 whitespace-nowrap flex flex flex-col items-start gap-2">
|
||||
<!--v-if-->
|
||||
<router-link-stub class="o-btn o-btn--small o-btn--text" role="button" data-oruga="button" to="[object Object]"></router-link-stub>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="border-b">
|
||||
<td class="py-4 px-2 whitespace-nowrap align-middle">Language</td>
|
||||
<td class="py-4 px-2 align-middle">French</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr class="border-b">
|
||||
<td class="py-4 px-2 whitespace-nowrap align-middle">Role</td>
|
||||
<td class="py-4 px-2 whitespace-nowrap"><span class="bg-orange-100 text-orange-800 text-sm font-medium mr-2 px-2.5 py-0.5 rounded">Pending</span></td>
|
||||
<td class="py-4 px-2 whitespace-nowrap flex items-center">
|
||||
<!--v-if-->
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="border-b">
|
||||
<td class="py-4 px-2 whitespace-nowrap align-middle">Moderation</td>
|
||||
<td class="py-4 px-2 align-middle">moderation text</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr class="border-b">
|
||||
<td class="py-4 px-2 whitespace-nowrap align-middle">Confirmed</td>
|
||||
<td class="py-4 px-2 align-middle">Saturday, August 30, 2025 at 11:56 AM</td>
|
||||
<td class="py-4 px-2 whitespace-nowrap flex items-center">
|
||||
<!--v-if-->
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="border-b">
|
||||
<td class="py-4 px-2 whitespace-nowrap align-middle">Last sign-in</td>
|
||||
<td class="py-4 px-2 align-middle">Unknown</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr class="border-b">
|
||||
<td class="py-4 px-2 whitespace-nowrap align-middle">Last IP adress</td>
|
||||
<td class="py-4 px-2 align-middle">Unknown</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
<!--v-if-->
|
||||
<section class="my-4">
|
||||
<h2 class="text-lg font-bold mb-3">Actions</h2>
|
||||
<table>
|
||||
<tr>
|
||||
<td>
|
||||
<div class="buttons"><button type="button" class="o-btn o-btn--success" role="button" data-oruga="button" id="acceptAccount"><span class="o-btn__wrapper"><!----><span class="o-btn__label">Accept</span>
|
||||
<!----></span>
|
||||
</button></div>
|
||||
</td>
|
||||
<td>
|
||||
<div class="buttons"><button type="button" class="o-btn o-btn--danger" role="button" data-oruga="button" id="deleteAccount"><span class="o-btn__wrapper"><!----><span class="o-btn__label">Ban</span>
|
||||
<!----></span>
|
||||
</button></div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</section>
|
||||
<!--teleport start-->
|
||||
<transition-stub name="zoom-out" appear="false" persisted="false" css="true">
|
||||
<div close-button-aria-label="Close" aria-modal="false" data-oruga="modal" class="o-modal" tabindex="-1" role="dialog" aria-label="Edit user email" style="display: none;">
|
||||
<div class="o-modal__overlay" tabindex="-1" aria-hidden="true"></div>
|
||||
<div class="o-modal__content" style="max-width: 960px;">
|
||||
<form>
|
||||
<div class="" style="width: auto;">
|
||||
<header class="">
|
||||
<h2>Change user email</h2>
|
||||
</header>
|
||||
<section class="">
|
||||
<div data-oruga="field" class="o-field o-field--filled"><label class="o-field__label" for="">Previous email</label>
|
||||
<div class="o-field__body">
|
||||
<div class="o-field o-field--addons">
|
||||
<div data-oruga="input" class="o-input__wrapper"><input id="" data-oruga-input="email" type="email" class="o-input o-input--disabled" autocomplete="off" disabled="">
|
||||
<!---->
|
||||
<!---->
|
||||
<!---->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!---->
|
||||
</div>
|
||||
<div data-oruga="field" class="o-field"><label class="o-field__label" for="">New email</label>
|
||||
<div class="o-field__body">
|
||||
<div class="o-field o-field--addons">
|
||||
<div data-oruga="input" class="o-input__wrapper"><input required="" id="" data-oruga-input="email" type="email" class="o-input" autocomplete="off" placeholder="new@email.com">
|
||||
<!---->
|
||||
<!---->
|
||||
<!---->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!---->
|
||||
</div><label class="o-chk o-chk--checked" data-oruga="checkbox" role="checkbox" aria-checked="true"><input type="checkbox" data-oruga-input="checkbox" class="o-chk__input o-chk__input--checked" autocomplete="off" true-value="true" false-value="false"><span class="o-chk__label">Notify the user of the change</span></label>
|
||||
</section>
|
||||
<footer class="mt-2 flex gap-2"><button type="button" class="o-btn o-btn--outlined" role="button" data-oruga="button"><span class="o-btn__wrapper"><!----><span class="o-btn__label">Close</span>
|
||||
<!----></span>
|
||||
</button><button type="submit" class="o-btn o-btn--primary" role="button" data-oruga="button"><span class="o-btn__wrapper"><!----><span class="o-btn__label">Change email</span>
|
||||
<!----></span>
|
||||
</button></footer>
|
||||
</div>
|
||||
</form><span class="o-icon o-icon--clickable o-icon--medium o-modal__close" data-oruga="icon" style="display: none;"><i class="mdi mdi-close mdi-36px"></i></span>
|
||||
</div>
|
||||
</div>
|
||||
</transition-stub>
|
||||
<!--teleport end-->
|
||||
<!--teleport start-->
|
||||
<transition-stub name="zoom-out" appear="false" persisted="false" css="true">
|
||||
<div has-modal-card="" close-button-aria-label="Close" aria-modal="false" data-oruga="modal" class="o-modal" tabindex="-1" role="dialog" aria-label="Edit user email" style="display: none;">
|
||||
<div class="o-modal__overlay" tabindex="-1" aria-hidden="true"></div>
|
||||
<div class="o-modal__content" style="max-width: 960px;">
|
||||
<form>
|
||||
<header>
|
||||
<h2>Change user role</h2>
|
||||
</header>
|
||||
<section>
|
||||
<div data-oruga="field" class="o-field">
|
||||
<!---->
|
||||
<div class="o-field__body">
|
||||
<div class="o-field o-field--addons"><label class="o-radio" data-oruga="radio" role="radio" aria-checked="false"><input type="radio" data-oruga-input="radio" class="o-radio__input" autocomplete="off" value="ADMINISTRATOR"><span class="o-radio__label">Administrator</span></label></div>
|
||||
</div>
|
||||
<!---->
|
||||
</div>
|
||||
<div data-oruga="field" class="o-field">
|
||||
<!---->
|
||||
<div class="o-field__body">
|
||||
<div class="o-field o-field--addons"><label class="o-radio" data-oruga="radio" role="radio" aria-checked="false"><input type="radio" data-oruga-input="radio" class="o-radio__input" autocomplete="off" value="MODERATOR"><span class="o-radio__label">Moderator</span></label></div>
|
||||
</div>
|
||||
<!---->
|
||||
</div>
|
||||
<div data-oruga="field" class="o-field">
|
||||
<!---->
|
||||
<div class="o-field__body">
|
||||
<div class="o-field o-field--addons"><label class="o-radio" data-oruga="radio" role="radio" aria-checked="false"><input type="radio" data-oruga-input="radio" class="o-radio__input" autocomplete="off" value="USER"><span class="o-radio__label">User</span></label></div>
|
||||
</div>
|
||||
<!---->
|
||||
</div><label class="o-chk o-chk--checked" data-oruga="checkbox" role="checkbox" aria-checked="true"><input type="checkbox" data-oruga-input="checkbox" class="o-chk__input o-chk__input--checked" autocomplete="off" true-value="true" false-value="false"><span class="o-chk__label">Notify the user of the change</span></label>
|
||||
</section>
|
||||
<footer class="mt-2 flex gap-2"><button type="button" class="o-btn o-btn--outlined" role="button" data-oruga="button"><span class="o-btn__wrapper"><!----><span class="o-btn__label">Close</span>
|
||||
<!----></span>
|
||||
</button><button type="submit" class="o-btn o-btn--primary" role="button" data-oruga="button"><span class="o-btn__wrapper"><!----><span class="o-btn__label">Change role</span>
|
||||
<!----></span>
|
||||
</button></footer>
|
||||
</form><span class="o-icon o-icon--clickable o-icon--medium o-modal__close" data-oruga="icon" style="display: none;"><i class="mdi mdi-close mdi-36px"></i></span>
|
||||
</div>
|
||||
</div>
|
||||
</transition-stub>
|
||||
<!--teleport end-->
|
||||
<!--teleport start-->
|
||||
<transition-stub name="zoom-out" appear="false" persisted="false" css="true">
|
||||
<div has-modal-card="" close-button-aria-label="Close" aria-modal="false" data-oruga="modal" class="o-modal" tabindex="-1" role="dialog" aria-label="Edit user email" style="display: none;">
|
||||
<div class="o-modal__overlay" tabindex="-1" aria-hidden="true"></div>
|
||||
<div class="o-modal__content" style="max-width: 960px;">
|
||||
<form>
|
||||
<header>
|
||||
<h2>Confirm user</h2>
|
||||
</header>
|
||||
<section><label class="o-chk o-chk--checked" data-oruga="checkbox" role="checkbox" aria-checked="true"><input type="checkbox" data-oruga-input="checkbox" class="o-chk__input o-chk__input--checked" autocomplete="off" true-value="true" false-value="false"><span class="o-chk__label">Notify the user of the change</span></label></section>
|
||||
<footer><button type="button" class="o-btn" role="button" data-oruga="button"><span class="o-btn__wrapper"><!----><span class="o-btn__label">Close</span>
|
||||
<!----></span>
|
||||
</button><button type="submit" class="o-btn o-btn--primary" role="button" data-oruga="button"><span class="o-btn__wrapper"><!----><span class="o-btn__label">Confirm user</span>
|
||||
<!----></span>
|
||||
</button></footer>
|
||||
</form><span class="o-icon o-icon--clickable o-icon--medium o-modal__close" data-oruga="icon" style="display: none;"><i class="mdi mdi-close mdi-36px"></i></span>
|
||||
</div>
|
||||
</div>
|
||||
</transition-stub>
|
||||
<!--teleport end-->
|
||||
</div>"
|
||||
`;
|
||||
|
||||
exports[`UsersView > Show simple list 1`] = `
|
||||
"<div>
|
||||
<breadcrumbs-nav links="[object Object],[object Object],[object Object]"></breadcrumbs-nav>
|
||||
<section>
|
||||
<h2 class="text-lg font-bold mb-3">Details</h2>
|
||||
<div class="flex flex-col">
|
||||
<div class="overflow-x-auto">
|
||||
<div class="inline-block py-2 min-w-full sm:px-2">
|
||||
<div class="overflow-hidden shadow-md sm:rounded-lg">
|
||||
<table class="table w-full">
|
||||
<tbody>
|
||||
<tr class="border-b">
|
||||
<td class="py-4 px-2 whitespace-nowrap align-middle">Email</td>
|
||||
<td class="py-4 px-2 align-middle">truc@mobilizon.test</td>
|
||||
<td class="py-4 px-2 whitespace-nowrap flex flex flex-col items-start gap-2"><button type="button" class="o-btn o-btn--small o-btn--text" role="button" data-oruga="button"><span class="o-btn__wrapper"><span class="o-icon o-icon--small o-btn__icon o-btn__icon-left" data-oruga="icon"><i class="mdi mdi-pencil"></i></span><span class="o-btn__label">Change email</span>
|
||||
<!----></span>
|
||||
</button>
|
||||
<router-link-stub class="o-btn o-btn--small o-btn--text" role="button" data-oruga="button" to="[object Object]"></router-link-stub>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="border-b">
|
||||
<td class="py-4 px-2 whitespace-nowrap align-middle">Language</td>
|
||||
<td class="py-4 px-2 align-middle">French</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr class="border-b">
|
||||
<td class="py-4 px-2 whitespace-nowrap align-middle">Role</td>
|
||||
<td class="py-4 px-2 whitespace-nowrap"><span class="bg-blue-100 text-blue-800 text-sm font-medium mr-2 px-2.5 py-0.5 rounded">User</span></td>
|
||||
<td class="py-4 px-2 whitespace-nowrap flex items-center"><button type="button" class="o-btn o-btn--small o-btn--text" role="button" data-oruga="button"><span class="o-btn__wrapper"><span class="o-icon o-icon--small o-btn__icon o-btn__icon-left" data-oruga="icon"><i class="mdi mdi-chevron-double-up"></i></span><span class="o-btn__label">Change role</span>
|
||||
<!----></span>
|
||||
</button></td>
|
||||
</tr>
|
||||
<tr class="border-b">
|
||||
<td class="py-4 px-2 whitespace-nowrap align-middle">Login status</td>
|
||||
<td class="py-4 px-2 align-middle">Activated</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr class="border-b">
|
||||
<td class="py-4 px-2 whitespace-nowrap align-middle">Confirmed</td>
|
||||
<td class="py-4 px-2 align-middle">Saturday, August 30, 2025 at 11:56 AM</td>
|
||||
<td class="py-4 px-2 whitespace-nowrap flex items-center">
|
||||
<!--v-if-->
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="border-b">
|
||||
<td class="py-4 px-2 whitespace-nowrap align-middle">Last sign-in</td>
|
||||
<td class="py-4 px-2 align-middle">Unknown</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr class="border-b">
|
||||
<td class="py-4 px-2 whitespace-nowrap align-middle">Last IP adress</td>
|
||||
<td class="py-4 px-2 align-middle">Unknown</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr class="border-b">
|
||||
<td class="py-4 px-2 whitespace-nowrap align-middle">Total number of participations</td>
|
||||
<td class="py-4 px-2 align-middle">14</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr class="border-b">
|
||||
<td class="py-4 px-2 whitespace-nowrap align-middle">Uploaded media total size</td>
|
||||
<td class="py-4 px-2 align-middle">6,76 mégaoctets</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
<section class="my-4">
|
||||
<h2 class="text-lg font-bold mb-3">Profiles</h2>
|
||||
<div class="flex flex-wrap justify-center sm:justify-start gap-4">
|
||||
<router-link-stub to="[object Object]" replace="false" custom="false" ariacurrentvalue="page" viewtransition="false"></router-link-stub>
|
||||
</div>
|
||||
</section>
|
||||
<section class="my-4">
|
||||
<h2 class="text-lg font-bold mb-3">Actions</h2>
|
||||
<table>
|
||||
<tr>
|
||||
<!--v-if-->
|
||||
<td>
|
||||
<div class="buttons"><button type="button" class="o-btn o-btn--danger" role="button" data-oruga="button" id="deleteAccount"><span class="o-btn__wrapper"><!----><span class="o-btn__label">Ban</span>
|
||||
<!----></span>
|
||||
</button></div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</section>
|
||||
<!--teleport start-->
|
||||
<transition-stub name="zoom-out" appear="false" persisted="false" css="true">
|
||||
<div close-button-aria-label="Close" aria-modal="false" data-oruga="modal" class="o-modal" tabindex="-1" role="dialog" aria-label="Edit user email" style="display: none;">
|
||||
<div class="o-modal__overlay" tabindex="-1" aria-hidden="true"></div>
|
||||
<div class="o-modal__content" style="max-width: 960px;">
|
||||
<form>
|
||||
<div class="" style="width: auto;">
|
||||
<header class="">
|
||||
<h2>Change user email</h2>
|
||||
</header>
|
||||
<section class="">
|
||||
<div data-oruga="field" class="o-field o-field--filled"><label class="o-field__label" for="">Previous email</label>
|
||||
<div class="o-field__body">
|
||||
<div class="o-field o-field--addons">
|
||||
<div data-oruga="input" class="o-input__wrapper"><input id="" data-oruga-input="email" type="email" class="o-input o-input--disabled" autocomplete="off" disabled="">
|
||||
<!---->
|
||||
<!---->
|
||||
<!---->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!---->
|
||||
</div>
|
||||
<div data-oruga="field" class="o-field"><label class="o-field__label" for="">New email</label>
|
||||
<div class="o-field__body">
|
||||
<div class="o-field o-field--addons">
|
||||
<div data-oruga="input" class="o-input__wrapper"><input required="" id="" data-oruga-input="email" type="email" class="o-input" autocomplete="off" placeholder="new@email.com">
|
||||
<!---->
|
||||
<!---->
|
||||
<!---->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!---->
|
||||
</div><label class="o-chk o-chk--checked" data-oruga="checkbox" role="checkbox" aria-checked="true"><input type="checkbox" data-oruga-input="checkbox" class="o-chk__input o-chk__input--checked" autocomplete="off" true-value="true" false-value="false"><span class="o-chk__label">Notify the user of the change</span></label>
|
||||
</section>
|
||||
<footer class="mt-2 flex gap-2"><button type="button" class="o-btn o-btn--outlined" role="button" data-oruga="button"><span class="o-btn__wrapper"><!----><span class="o-btn__label">Close</span>
|
||||
<!----></span>
|
||||
</button><button type="submit" class="o-btn o-btn--primary" role="button" data-oruga="button"><span class="o-btn__wrapper"><!----><span class="o-btn__label">Change email</span>
|
||||
<!----></span>
|
||||
</button></footer>
|
||||
</div>
|
||||
</form><span class="o-icon o-icon--clickable o-icon--medium o-modal__close" data-oruga="icon" style="display: none;"><i class="mdi mdi-close mdi-36px"></i></span>
|
||||
</div>
|
||||
</div>
|
||||
</transition-stub>
|
||||
<!--teleport end-->
|
||||
<!--teleport start-->
|
||||
<transition-stub name="zoom-out" appear="false" persisted="false" css="true">
|
||||
<div has-modal-card="" close-button-aria-label="Close" aria-modal="false" data-oruga="modal" class="o-modal" tabindex="-1" role="dialog" aria-label="Edit user email" style="display: none;">
|
||||
<div class="o-modal__overlay" tabindex="-1" aria-hidden="true"></div>
|
||||
<div class="o-modal__content" style="max-width: 960px;">
|
||||
<form>
|
||||
<header>
|
||||
<h2>Change user role</h2>
|
||||
</header>
|
||||
<section>
|
||||
<div data-oruga="field" class="o-field">
|
||||
<!---->
|
||||
<div class="o-field__body">
|
||||
<div class="o-field o-field--addons"><label class="o-radio" data-oruga="radio" role="radio" aria-checked="false"><input type="radio" data-oruga-input="radio" class="o-radio__input" autocomplete="off" value="ADMINISTRATOR"><span class="o-radio__label">Administrator</span></label></div>
|
||||
</div>
|
||||
<!---->
|
||||
</div>
|
||||
<div data-oruga="field" class="o-field">
|
||||
<!---->
|
||||
<div class="o-field__body">
|
||||
<div class="o-field o-field--addons"><label class="o-radio" data-oruga="radio" role="radio" aria-checked="false"><input type="radio" data-oruga-input="radio" class="o-radio__input" autocomplete="off" value="MODERATOR"><span class="o-radio__label">Moderator</span></label></div>
|
||||
</div>
|
||||
<!---->
|
||||
</div>
|
||||
<div data-oruga="field" class="o-field">
|
||||
<!---->
|
||||
<div class="o-field__body">
|
||||
<div class="o-field o-field--addons"><label class="o-radio o-radio--checked" data-oruga="radio" role="radio" aria-checked="true"><input type="radio" data-oruga-input="radio" class="o-radio__input o-radio__input--checked" autocomplete="off" value="USER"><span class="o-radio__label">User</span></label></div>
|
||||
</div>
|
||||
<!---->
|
||||
</div><label class="o-chk o-chk--checked" data-oruga="checkbox" role="checkbox" aria-checked="true"><input type="checkbox" data-oruga-input="checkbox" class="o-chk__input o-chk__input--checked" autocomplete="off" true-value="true" false-value="false"><span class="o-chk__label">Notify the user of the change</span></label>
|
||||
</section>
|
||||
<footer class="mt-2 flex gap-2"><button type="button" class="o-btn o-btn--outlined" role="button" data-oruga="button"><span class="o-btn__wrapper"><!----><span class="o-btn__label">Close</span>
|
||||
<!----></span>
|
||||
</button><button type="submit" class="o-btn o-btn--primary" role="button" data-oruga="button"><span class="o-btn__wrapper"><!----><span class="o-btn__label">Change role</span>
|
||||
<!----></span>
|
||||
</button></footer>
|
||||
</form><span class="o-icon o-icon--clickable o-icon--medium o-modal__close" data-oruga="icon" style="display: none;"><i class="mdi mdi-close mdi-36px"></i></span>
|
||||
</div>
|
||||
</div>
|
||||
</transition-stub>
|
||||
<!--teleport end-->
|
||||
<!--teleport start-->
|
||||
<transition-stub name="zoom-out" appear="false" persisted="false" css="true">
|
||||
<div has-modal-card="" close-button-aria-label="Close" aria-modal="false" data-oruga="modal" class="o-modal" tabindex="-1" role="dialog" aria-label="Edit user email" style="display: none;">
|
||||
<div class="o-modal__overlay" tabindex="-1" aria-hidden="true"></div>
|
||||
<div class="o-modal__content" style="max-width: 960px;">
|
||||
<form>
|
||||
<header>
|
||||
<h2>Confirm user</h2>
|
||||
</header>
|
||||
<section><label class="o-chk o-chk--checked" data-oruga="checkbox" role="checkbox" aria-checked="true"><input type="checkbox" data-oruga-input="checkbox" class="o-chk__input o-chk__input--checked" autocomplete="off" true-value="true" false-value="false"><span class="o-chk__label">Notify the user of the change</span></label></section>
|
||||
<footer><button type="button" class="o-btn" role="button" data-oruga="button"><span class="o-btn__wrapper"><!----><span class="o-btn__label">Close</span>
|
||||
<!----></span>
|
||||
</button><button type="submit" class="o-btn o-btn--primary" role="button" data-oruga="button"><span class="o-btn__wrapper"><!----><span class="o-btn__label">Confirm user</span>
|
||||
<!----></span>
|
||||
</button></footer>
|
||||
</form><span class="o-icon o-icon--clickable o-icon--medium o-modal__close" data-oruga="icon" style="display: none;"><i class="mdi mdi-close mdi-36px"></i></span>
|
||||
</div>
|
||||
</div>
|
||||
</transition-stub>
|
||||
<!--teleport end-->
|
||||
</div>"
|
||||
`;
|
||||
|
||||
exports[`UsersView > Unban user 1`] = `
|
||||
"<div>
|
||||
<breadcrumbs-nav links="[object Object],[object Object],[object Object]"></breadcrumbs-nav>
|
||||
<section>
|
||||
<h2 class="text-lg font-bold mb-3">Details</h2>
|
||||
<div class="flex flex-col">
|
||||
<div class="overflow-x-auto">
|
||||
<div class="inline-block py-2 min-w-full sm:px-2">
|
||||
<div class="overflow-hidden shadow-md sm:rounded-lg">
|
||||
<table class="table w-full">
|
||||
<tbody>
|
||||
<tr class="border-b">
|
||||
<td class="py-4 px-2 whitespace-nowrap align-middle">Email</td>
|
||||
<td class="py-4 px-2 align-middle">truc@mobilizon.test</td>
|
||||
<td class="py-4 px-2 whitespace-nowrap flex flex flex-col items-start gap-2">
|
||||
<!--v-if-->
|
||||
<router-link-stub class="o-btn o-btn--small o-btn--text" role="button" data-oruga="button" to="[object Object]"></router-link-stub>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="border-b">
|
||||
<td class="py-4 px-2 whitespace-nowrap align-middle">Language</td>
|
||||
<td class="py-4 px-2 align-middle">French</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr class="border-b">
|
||||
<td class="py-4 px-2 whitespace-nowrap align-middle">Role</td>
|
||||
<td class="py-4 px-2 whitespace-nowrap"><span class="bg-blue-100 text-blue-800 text-sm font-medium mr-2 px-2.5 py-0.5 rounded">User</span></td>
|
||||
<td class="py-4 px-2 whitespace-nowrap flex items-center">
|
||||
<!--v-if-->
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="border-b">
|
||||
<td class="py-4 px-2 whitespace-nowrap align-middle">Login status</td>
|
||||
<td class="py-4 px-2 align-middle">Disabled</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr class="border-b">
|
||||
<td class="py-4 px-2 whitespace-nowrap align-middle">Confirmed</td>
|
||||
<td class="py-4 px-2 align-middle">Saturday, August 30, 2025 at 11:56 AM</td>
|
||||
<td class="py-4 px-2 whitespace-nowrap flex items-center"><button type="button" class="o-btn o-btn--small o-btn--text" role="button" data-oruga="button"><span class="o-btn__wrapper"><span class="o-icon o-icon--small o-btn__icon o-btn__icon-left" data-oruga="icon"><i class="mdi mdi-check"></i></span><span class="o-btn__label">Confirm user</span>
|
||||
<!----></span>
|
||||
</button></td>
|
||||
</tr>
|
||||
<tr class="border-b">
|
||||
<td class="py-4 px-2 whitespace-nowrap align-middle">Last sign-in</td>
|
||||
<td class="py-4 px-2 align-middle">Unknown</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr class="border-b">
|
||||
<td class="py-4 px-2 whitespace-nowrap align-middle">Last IP adress</td>
|
||||
<td class="py-4 px-2 align-middle">Unknown</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr class="border-b">
|
||||
<td class="py-4 px-2 whitespace-nowrap align-middle">Total number of participations</td>
|
||||
<td class="py-4 px-2 align-middle">14</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr class="border-b">
|
||||
<td class="py-4 px-2 whitespace-nowrap align-middle">Uploaded media total size</td>
|
||||
<td class="py-4 px-2 align-middle">6,76 mégaoctets</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
<section class="my-4">
|
||||
<h2 class="text-lg font-bold mb-3">Profiles</h2>
|
||||
<div class="flex flex-wrap justify-center sm:justify-start gap-4">
|
||||
<router-link-stub to="[object Object]" replace="false" custom="false" ariacurrentvalue="page" viewtransition="false"></router-link-stub>
|
||||
</div>
|
||||
</section>
|
||||
<section class="my-4">
|
||||
<h2 class="text-lg font-bold mb-3">Actions</h2>
|
||||
<table>
|
||||
<tr>
|
||||
<!--v-if-->
|
||||
<td>
|
||||
<div>
|
||||
<div class="p-4 mb-4 text-sm text-red-700 bg-red-100 rounded-lg" role="alert">The user has been banned</div><button type="button" class="o-btn o-btn--danger" role="button" data-oruga="button" id="unbanAccount"><span class="o-btn__wrapper"><!----><span class="o-btn__label">Unban</span>
|
||||
<!----></span>
|
||||
</button>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</section>
|
||||
<!--teleport start-->
|
||||
<transition-stub name="zoom-out" appear="false" persisted="false" css="true">
|
||||
<div close-button-aria-label="Close" aria-modal="false" data-oruga="modal" class="o-modal" tabindex="-1" role="dialog" aria-label="Edit user email" style="display: none;">
|
||||
<div class="o-modal__overlay" tabindex="-1" aria-hidden="true"></div>
|
||||
<div class="o-modal__content" style="max-width: 960px;">
|
||||
<form>
|
||||
<div class="" style="width: auto;">
|
||||
<header class="">
|
||||
<h2>Change user email</h2>
|
||||
</header>
|
||||
<section class="">
|
||||
<div data-oruga="field" class="o-field o-field--filled"><label class="o-field__label" for="">Previous email</label>
|
||||
<div class="o-field__body">
|
||||
<div class="o-field o-field--addons">
|
||||
<div data-oruga="input" class="o-input__wrapper"><input id="" data-oruga-input="email" type="email" class="o-input o-input--disabled" autocomplete="off" disabled="">
|
||||
<!---->
|
||||
<!---->
|
||||
<!---->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!---->
|
||||
</div>
|
||||
<div data-oruga="field" class="o-field"><label class="o-field__label" for="">New email</label>
|
||||
<div class="o-field__body">
|
||||
<div class="o-field o-field--addons">
|
||||
<div data-oruga="input" class="o-input__wrapper"><input required="" id="" data-oruga-input="email" type="email" class="o-input" autocomplete="off" placeholder="new@email.com">
|
||||
<!---->
|
||||
<!---->
|
||||
<!---->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!---->
|
||||
</div><label class="o-chk o-chk--checked" data-oruga="checkbox" role="checkbox" aria-checked="true"><input type="checkbox" data-oruga-input="checkbox" class="o-chk__input o-chk__input--checked" autocomplete="off" true-value="true" false-value="false"><span class="o-chk__label">Notify the user of the change</span></label>
|
||||
</section>
|
||||
<footer class="mt-2 flex gap-2"><button type="button" class="o-btn o-btn--outlined" role="button" data-oruga="button"><span class="o-btn__wrapper"><!----><span class="o-btn__label">Close</span>
|
||||
<!----></span>
|
||||
</button><button type="submit" class="o-btn o-btn--primary" role="button" data-oruga="button"><span class="o-btn__wrapper"><!----><span class="o-btn__label">Change email</span>
|
||||
<!----></span>
|
||||
</button></footer>
|
||||
</div>
|
||||
</form><span class="o-icon o-icon--clickable o-icon--medium o-modal__close" data-oruga="icon" style="display: none;"><i class="mdi mdi-close mdi-36px"></i></span>
|
||||
</div>
|
||||
</div>
|
||||
</transition-stub>
|
||||
<!--teleport end-->
|
||||
<!--teleport start-->
|
||||
<transition-stub name="zoom-out" appear="false" persisted="false" css="true">
|
||||
<div has-modal-card="" close-button-aria-label="Close" aria-modal="false" data-oruga="modal" class="o-modal" tabindex="-1" role="dialog" aria-label="Edit user email" style="display: none;">
|
||||
<div class="o-modal__overlay" tabindex="-1" aria-hidden="true"></div>
|
||||
<div class="o-modal__content" style="max-width: 960px;">
|
||||
<form>
|
||||
<header>
|
||||
<h2>Change user role</h2>
|
||||
</header>
|
||||
<section>
|
||||
<div data-oruga="field" class="o-field">
|
||||
<!---->
|
||||
<div class="o-field__body">
|
||||
<div class="o-field o-field--addons"><label class="o-radio" data-oruga="radio" role="radio" aria-checked="false"><input type="radio" data-oruga-input="radio" class="o-radio__input" autocomplete="off" value="ADMINISTRATOR"><span class="o-radio__label">Administrator</span></label></div>
|
||||
</div>
|
||||
<!---->
|
||||
</div>
|
||||
<div data-oruga="field" class="o-field">
|
||||
<!---->
|
||||
<div class="o-field__body">
|
||||
<div class="o-field o-field--addons"><label class="o-radio" data-oruga="radio" role="radio" aria-checked="false"><input type="radio" data-oruga-input="radio" class="o-radio__input" autocomplete="off" value="MODERATOR"><span class="o-radio__label">Moderator</span></label></div>
|
||||
</div>
|
||||
<!---->
|
||||
</div>
|
||||
<div data-oruga="field" class="o-field">
|
||||
<!---->
|
||||
<div class="o-field__body">
|
||||
<div class="o-field o-field--addons"><label class="o-radio o-radio--checked" data-oruga="radio" role="radio" aria-checked="true"><input type="radio" data-oruga-input="radio" class="o-radio__input o-radio__input--checked" autocomplete="off" value="USER"><span class="o-radio__label">User</span></label></div>
|
||||
</div>
|
||||
<!---->
|
||||
</div><label class="o-chk o-chk--checked" data-oruga="checkbox" role="checkbox" aria-checked="true"><input type="checkbox" data-oruga-input="checkbox" class="o-chk__input o-chk__input--checked" autocomplete="off" true-value="true" false-value="false"><span class="o-chk__label">Notify the user of the change</span></label>
|
||||
</section>
|
||||
<footer class="mt-2 flex gap-2"><button type="button" class="o-btn o-btn--outlined" role="button" data-oruga="button"><span class="o-btn__wrapper"><!----><span class="o-btn__label">Close</span>
|
||||
<!----></span>
|
||||
</button><button type="submit" class="o-btn o-btn--primary" role="button" data-oruga="button"><span class="o-btn__wrapper"><!----><span class="o-btn__label">Change role</span>
|
||||
<!----></span>
|
||||
</button></footer>
|
||||
</form><span class="o-icon o-icon--clickable o-icon--medium o-modal__close" data-oruga="icon" style="display: none;"><i class="mdi mdi-close mdi-36px"></i></span>
|
||||
</div>
|
||||
</div>
|
||||
</transition-stub>
|
||||
<!--teleport end-->
|
||||
<!--teleport start-->
|
||||
<transition-stub name="zoom-out" appear="false" persisted="false" css="true">
|
||||
<div has-modal-card="" close-button-aria-label="Close" aria-modal="false" data-oruga="modal" class="o-modal" tabindex="-1" role="dialog" aria-label="Edit user email" style="display: none;">
|
||||
<div class="o-modal__overlay" tabindex="-1" aria-hidden="true"></div>
|
||||
<div class="o-modal__content" style="max-width: 960px;">
|
||||
<form>
|
||||
<header>
|
||||
<h2>Confirm user</h2>
|
||||
</header>
|
||||
<section><label class="o-chk o-chk--checked" data-oruga="checkbox" role="checkbox" aria-checked="true"><input type="checkbox" data-oruga-input="checkbox" class="o-chk__input o-chk__input--checked" autocomplete="off" true-value="true" false-value="false"><span class="o-chk__label">Notify the user of the change</span></label></section>
|
||||
<footer><button type="button" class="o-btn" role="button" data-oruga="button"><span class="o-btn__wrapper"><!----><span class="o-btn__label">Close</span>
|
||||
<!----></span>
|
||||
</button><button type="submit" class="o-btn o-btn--primary" role="button" data-oruga="button"><span class="o-btn__wrapper"><!----><span class="o-btn__label">Confirm user</span>
|
||||
<!----></span>
|
||||
</button></footer>
|
||||
</form><span class="o-icon o-icon--clickable o-icon--medium o-modal__close" data-oruga="icon" style="display: none;"><i class="mdi mdi-close mdi-36px"></i></span>
|
||||
</div>
|
||||
</div>
|
||||
</transition-stub>
|
||||
<!--teleport end-->
|
||||
</div>"
|
||||
`;
|
||||
@@ -1,28 +0,0 @@
|
||||
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
|
||||
|
||||
exports[`Dashboard > Show simple 1`] = `
|
||||
"<div>
|
||||
<breadcrumbs-nav links="[object Object],[object Object]"></breadcrumbs-nav>
|
||||
<section>
|
||||
<h1>Administration</h1>
|
||||
<div class="grid grid-cols-1 lg:grid-rows-2 lg:grid-flow-col gap-x-4 items-stretch">
|
||||
<number-dashboard-tile-stub number="340"></number-dashboard-tile-stub>
|
||||
<linked-number-dashboard-tile-stub subtitle="Groups" to="[object Object]" number="67"></linked-number-dashboard-tile-stub>
|
||||
<linked-number-dashboard-tile-stub subtitle="Users" to="[object Object]" number="220"></linked-number-dashboard-tile-stub>
|
||||
<linked-number-dashboard-tile-stub subtitle="Opened reports" to="[object Object]" number="9"></linked-number-dashboard-tile-stub>
|
||||
<linked-number-dashboard-tile-stub subtitle="Instances following you" to="[object Object]" number="12"></linked-number-dashboard-tile-stub>
|
||||
<linked-number-dashboard-tile-stub subtitle="Instances you follow" to="[object Object]" number="35"></linked-number-dashboard-tile-stub>
|
||||
</div>
|
||||
<div class="flex flex-wrap gap-4">
|
||||
<div>
|
||||
<h2>Last published event</h2>
|
||||
<event-card-stub event="[object Object]" mode="column"></event-card-stub>
|
||||
</div>
|
||||
<div>
|
||||
<h2>Last group created</h2>
|
||||
<group-card-stub group="[object Object]" showsummary="true" isremotegroup="false" isloggedin="true" mode="column"></group-card-stub>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>"
|
||||
`;
|
||||
@@ -1,122 +0,0 @@
|
||||
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
|
||||
|
||||
exports[`GroupProfiles > Show simple 1`] = `
|
||||
"<div data-v-0a4382af="">
|
||||
<breadcrumbs-nav data-v-0a4382af="" links="[object Object],[object Object]"></breadcrumbs-nav>
|
||||
<!--v-if-->
|
||||
<div data-v-0a4382af="">
|
||||
<div data-v-0a4382af="" class="flex gap-2"><label data-v-0a4382af="" class="o-switch o-switch--right" data-oruga="switch" role="switch" aria-checked="true"><input type="checkbox" role="switch" data-oruga-input="switch" class="o-switch__input o-switch__input--checked" autocomplete="off" true-value="true" false-value="false"><span class="o-switch__check o-switch__check--checked o-switch--rounded"><span class="o-switch__check-switch o-switch--rounded"></span></span><span class="o-switch__label">Local</span></label><label data-v-0a4382af="" class="o-switch o-switch--right" data-oruga="switch" role="switch" aria-checked="false"><input type="checkbox" role="switch" data-oruga-input="switch" class="o-switch__input" autocomplete="off" true-value="true" false-value="false"><span class="o-switch__check o-switch--rounded"><span class="o-switch__check-switch o-switch--rounded"></span></span><span class="o-switch__label">Suspended</span></label></div>
|
||||
<div data-v-0a4382af="" class="o-table__root" data-oruga="table">
|
||||
<div style="display: none;"><span data-v-0a4382af="" data-id="1" data-oruga="table-column">Username <!----></span><span data-v-0a4382af="" data-id="2" data-oruga="table-column">Domain <!----></span></div>
|
||||
<!---->
|
||||
<!---->
|
||||
<div class="o-table__wrapper">
|
||||
<table class="o-table">
|
||||
<!---->
|
||||
<thead>
|
||||
<tr>
|
||||
<!---->
|
||||
<!---->
|
||||
<th class="o-table__th" draggable="false"><span>Username <span class="o-table__th__sort-icon" style="display: none;"><span class="o-icon o-icon--small" data-oruga="icon"><i class="mdi mdi-arrow-up"></i></span></span></span></th>
|
||||
<th class="o-table__th" draggable="false"><span>Domain <span class="o-table__th__sort-icon" style="display: none;"><span class="o-icon o-icon--small" data-oruga="icon"><i class="mdi mdi-arrow-up"></i></span></span></span></th>
|
||||
<!---->
|
||||
</tr>
|
||||
<tr>
|
||||
<!---->
|
||||
<!---->
|
||||
<th class="o-table__th"><span><div data-v-0a4382af="" data-oruga="input" class="o-input__wrapper"><input aria-label="Filter" id="" data-oruga-input="text" type="text" class="o-input o-input--iconspace-left" autocomplete="off" placeholder="Filter"><span class="o-icon o-input__icon-left" data-oruga="icon"><i class="mdi mdi-magnify mdi-24px"></i></span>
|
||||
<!---->
|
||||
<!---->
|
||||
</div></span></th>
|
||||
<th class="o-table__th"><span><div data-v-0a4382af="" data-oruga="input" class="o-input__wrapper"><input aria-label="Filter" id="" data-oruga-input="text" type="text" class="o-input o-input--iconspace-left" autocomplete="off" placeholder="Filter"><span class="o-icon o-input__icon-left" data-oruga="icon"><i class="mdi mdi-magnify mdi-24px"></i></span>
|
||||
<!---->
|
||||
<!---->
|
||||
</div></span></th>
|
||||
<!---->
|
||||
</tr>
|
||||
<!---->
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr class="" draggable="false">
|
||||
<!---->
|
||||
<!---->
|
||||
<td class="o-table__td" data-label="Username"><a data-v-0a4382af="" href="/settings/admin/groups/1125368" class="profile">
|
||||
<article data-v-0a4382af="" class="flex gap-1"><span data-v-0a4382af="" aria-hidden="true" class="material-design-icon account-group-icon" role="img"><svg fill="currentColor" class="material-design-icon__svg" width="48" height="48" viewBox="0 0 24 24"><path d="M12,5.5A3.5,3.5 0 0,1 15.5,9A3.5,3.5 0 0,1 12,12.5A3.5,3.5 0 0,1 8.5,9A3.5,3.5 0 0,1 12,5.5M5,8C5.56,8 6.08,8.15 6.53,8.42C6.38,9.85 6.8,11.27 7.66,12.38C7.16,13.34 6.16,14 5,14A3,3 0 0,1 2,11A3,3 0 0,1 5,8M19,8A3,3 0 0,1 22,11A3,3 0 0,1 19,14C17.84,14 16.84,13.34 16.34,12.38C17.2,11.27 17.62,9.85 17.47,8.42C17.92,8.15 18.44,8 19,8M5.5,18.25C5.5,16.18 8.41,14.5 12,14.5C15.59,14.5 18.5,16.18 18.5,18.25V20H5.5V18.25M0,20V18.5C0,17.11 1.89,15.94 4.45,15.6C3.86,16.28 3.5,17.22 3.5,18.25V20H0M24,20H20.5V18.25C20.5,17.22 20.14,16.28 19.55,15.6C22.11,15.94 24,17.11 24,18.5V20Z"><!--v-if--></path></svg></span>
|
||||
<div data-v-0a4382af="" class="">
|
||||
<div data-v-0a4382af="" class="prose dark:prose-invert">
|
||||
<p data-v-0a4382af="" class="font-bold mb-0">Group #1</p><span data-v-0a4382af="" class="text-sm">@group1</span>
|
||||
</div>
|
||||
</div>
|
||||
</article>
|
||||
</a></td>
|
||||
<td class="o-table__td" data-label="Domain"></td>
|
||||
<!---->
|
||||
</tr>
|
||||
<transition-stub name="slide" appear="false" persisted="false" css="true">
|
||||
<!---->
|
||||
</transition-stub>
|
||||
<!---->
|
||||
<tr class="" draggable="false">
|
||||
<!---->
|
||||
<!---->
|
||||
<td class="o-table__td" data-label="Username"><a data-v-0a4382af="" href="/settings/admin/groups/175368" class="profile">
|
||||
<article data-v-0a4382af="" class="flex gap-1"><span data-v-0a4382af="" aria-hidden="true" class="material-design-icon account-group-icon" role="img"><svg fill="currentColor" class="material-design-icon__svg" width="48" height="48" viewBox="0 0 24 24"><path d="M12,5.5A3.5,3.5 0 0,1 15.5,9A3.5,3.5 0 0,1 12,12.5A3.5,3.5 0 0,1 8.5,9A3.5,3.5 0 0,1 12,5.5M5,8C5.56,8 6.08,8.15 6.53,8.42C6.38,9.85 6.8,11.27 7.66,12.38C7.16,13.34 6.16,14 5,14A3,3 0 0,1 2,11A3,3 0 0,1 5,8M19,8A3,3 0 0,1 22,11A3,3 0 0,1 19,14C17.84,14 16.84,13.34 16.34,12.38C17.2,11.27 17.62,9.85 17.47,8.42C17.92,8.15 18.44,8 19,8M5.5,18.25C5.5,16.18 8.41,14.5 12,14.5C15.59,14.5 18.5,16.18 18.5,18.25V20H5.5V18.25M0,20V18.5C0,17.11 1.89,15.94 4.45,15.6C3.86,16.28 3.5,17.22 3.5,18.25V20H0M24,20H20.5V18.25C20.5,17.22 20.14,16.28 19.55,15.6C22.11,15.94 24,17.11 24,18.5V20Z"><!--v-if--></path></svg></span>
|
||||
<div data-v-0a4382af="" class="">
|
||||
<div data-v-0a4382af="" class="prose dark:prose-invert">
|
||||
<p data-v-0a4382af="" class="font-bold mb-0">Group #4</p><span data-v-0a4382af="" class="text-sm">@group4</span>
|
||||
</div>
|
||||
</div>
|
||||
</article>
|
||||
</a></td>
|
||||
<td class="o-table__td" data-label="Domain"></td>
|
||||
<!---->
|
||||
</tr>
|
||||
<transition-stub name="slide" appear="false" persisted="false" css="true">
|
||||
<!---->
|
||||
</transition-stub>
|
||||
<!---->
|
||||
<tr class="" draggable="false">
|
||||
<!---->
|
||||
<!---->
|
||||
<td class="o-table__td" data-label="Username"><a data-v-0a4382af="" href="/settings/admin/groups/1126368" class="profile">
|
||||
<article data-v-0a4382af="" class="flex gap-1"><span data-v-0a4382af="" aria-hidden="true" class="material-design-icon account-group-icon" role="img"><svg fill="currentColor" class="material-design-icon__svg" width="48" height="48" viewBox="0 0 24 24"><path d="M12,5.5A3.5,3.5 0 0,1 15.5,9A3.5,3.5 0 0,1 12,12.5A3.5,3.5 0 0,1 8.5,9A3.5,3.5 0 0,1 12,5.5M5,8C5.56,8 6.08,8.15 6.53,8.42C6.38,9.85 6.8,11.27 7.66,12.38C7.16,13.34 6.16,14 5,14A3,3 0 0,1 2,11A3,3 0 0,1 5,8M19,8A3,3 0 0,1 22,11A3,3 0 0,1 19,14C17.84,14 16.84,13.34 16.34,12.38C17.2,11.27 17.62,9.85 17.47,8.42C17.92,8.15 18.44,8 19,8M5.5,18.25C5.5,16.18 8.41,14.5 12,14.5C15.59,14.5 18.5,16.18 18.5,18.25V20H5.5V18.25M0,20V18.5C0,17.11 1.89,15.94 4.45,15.6C3.86,16.28 3.5,17.22 3.5,18.25V20H0M24,20H20.5V18.25C20.5,17.22 20.14,16.28 19.55,15.6C22.11,15.94 24,17.11 24,18.5V20Z"><!--v-if--></path></svg></span>
|
||||
<div data-v-0a4382af="" class="">
|
||||
<div data-v-0a4382af="" class="prose dark:prose-invert">
|
||||
<p data-v-0a4382af="" class="font-bold mb-0">Group #2</p><span data-v-0a4382af="" class="text-sm">@group2</span>
|
||||
</div>
|
||||
</div>
|
||||
</article>
|
||||
</a></td>
|
||||
<td class="o-table__td" data-label="Domain"></td>
|
||||
<!---->
|
||||
</tr>
|
||||
<transition-stub name="slide" appear="false" persisted="false" css="true">
|
||||
<!---->
|
||||
</transition-stub>
|
||||
<!---->
|
||||
<!---->
|
||||
</tbody>
|
||||
<!---->
|
||||
</table>
|
||||
<transition-stub name="fade" appear="false" persisted="false" css="true">
|
||||
<!---->
|
||||
</transition-stub>
|
||||
</div>
|
||||
<div class="o-table__pagination" per-page="10" total="3" rounded="false" size="small" simple="false" aria-next-label="Next page" aria-previous-label="Previous page" aria-page-label="Page" aria-current-label="Current page">
|
||||
<div></div>
|
||||
<div>
|
||||
<nav class="o-pag o-pag--right o-pag--small" data-oruga="pagination"><button role="button" tabindex="0" class="o-pag__link o-pag__previous o-pag__link--disabled" aria-label="Previous page" aria-current="false"><span class="o-icon" data-oruga="icon" aria-hidden="true"><i class="mdi mdi-chevron-left mdi-24px"></i></span></button><button role="button" tabindex="0" class="o-pag__link o-pag__next o-pag__link--disabled" aria-label="Next page" aria-current="false"><span class="o-icon" data-oruga="icon" aria-hidden="true"><i class="mdi mdi-chevron-right mdi-24px"></i></span></button>
|
||||
<ul class="o-pag__list">
|
||||
<!---->
|
||||
<!---->
|
||||
<li class="o-pag__item"><button role="button" tabindex="0" class="o-pag__link o-pag__link--current" aria-label="Current page, Page 1." aria-current="true">1</button></li>
|
||||
<!---->
|
||||
<!---->
|
||||
</ul>
|
||||
</nav>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>"
|
||||
`;
|
||||
@@ -1,33 +0,0 @@
|
||||
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
|
||||
|
||||
exports[`InstanceView > Show simple 1`] = `
|
||||
"<div>
|
||||
<breadcrumbs-nav links="[object Object],[object Object],[object Object]"></breadcrumbs-nav>
|
||||
<section class="flex flex-wrap md:flex-nowrap items-center justify-between gap-4">
|
||||
<div>
|
||||
<h2 class="text-4xl font-bold">Mobilizon</h2>
|
||||
<p class="text-slate-700 dark:text-slate-400 my-4">Mobilizon for test</p>Software details: <span class="capitalize">Mobilizon - 5.2.0</span>
|
||||
</div><a class="o-btn mx-auto md:mx-0" role="button" data-oruga="button" href="https://mobilizon.test" target="_blank" rel="noopener noreferrer"><span class="o-btn__wrapper"><!----><span class="o-btn__label">Visit mobilizon.test</span><span class="o-icon o-btn__icon o-btn__icon-right" data-oruga="icon"><i class="mdi mdi-open-in-new mdi-24px"></i></span></span></a>
|
||||
</section>
|
||||
<section>
|
||||
<div class="grid md:grid-cols-2 xl:grid-cols-4 gap-2 content-center text-center mt-2">
|
||||
<div class="bg-zinc-50 dark:bg-mbz-purple-500 rounded-xl p-8"><a href="/settings/admin/profiles?domain=mobilizon.test" class=""><span class="mb-4 text-xl font-semibold block">5</span><span class="text-sm block">Profiles</span></a></div>
|
||||
<div class="bg-gray-50 dark:bg-mbz-purple-500 rounded-xl p-8"><a href="/settings/admin/groups?domain=mobilizon.test" class=""><span class="mb-4 text-xl font-semibold block">1</span><span class="text-sm block">Groups</span></a></div>
|
||||
<div class="bg-zinc-50 dark:bg-mbz-purple-500 rounded-xl p-8"><span class="mb-4 text-xl font-semibold block">0</span><span class="text-sm block">Followings</span></div>
|
||||
<div class="bg-zinc-50 dark:bg-mbz-purple-500 rounded-xl p-8"><span class="mb-4 text-xl font-semibold block">0</span><span class="text-sm block">Followers</span></div>
|
||||
<div class="bg-zinc-50 dark:bg-mbz-purple-500 rounded-xl p-8"><a href="/moderation/reports?domain=mobilizon.test" class=""><span class="mb-4 text-xl font-semibold block">1</span><span class="text-sm block">Reports</span></a></div>
|
||||
<div class="bg-zinc-50 dark:bg-mbz-purple-500 rounded-xl p-8"><span class="mb-4 font-semibold block">2,81 mégaoctets</span><span class="text-sm block">Uploaded media size</span></div>
|
||||
</div>
|
||||
</section>
|
||||
<section>
|
||||
<div class="mt-3 grid xl:grid-cols-2 gap-4">
|
||||
<div class="border bg-white dark:bg-mbz-purple-500 dark:border-mbz-purple-700 p-6 shadow-md rounded-md flex flex-col gap-2 justify-center"><button class="bg-primary hover:bg-primary-700 focus:outline-none focus:ring-2 focus:ring-gray-400 focus:ring-offset-2 focus:ring-offset-gray-50 text-white hover:text-white font-semibold h-12 px-6 rounded-lg w-full flex items-center justify-center sm:w-auto">Follow instance</button></div>
|
||||
<div class="border bg-white dark:bg-mbz-purple-500 dark:border-mbz-purple-700 p-6 shadow-md rounded-md flex flex-col gap-2 justify-center">
|
||||
<!--v-if-->
|
||||
<!--v-if-->
|
||||
<p>This instance doesn't follow yours.</p>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>"
|
||||
`;
|
||||
@@ -1,119 +0,0 @@
|
||||
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
|
||||
|
||||
exports[`InstancesView > Show simple 1`] = `
|
||||
"<div data-v-364450c8="">
|
||||
<breadcrumbs-nav data-v-364450c8="" links="[object Object],[object Object]"></breadcrumbs-nav>
|
||||
<section data-v-364450c8="">
|
||||
<h1 data-v-364450c8="" class="title">Instances</h1>
|
||||
<form data-v-364450c8="" class="my-4">
|
||||
<div data-v-364450c8="" data-oruga="field" class="o-field o-field--horizontal">
|
||||
<div class="o-field__horizontal-label"><label for="newRelayAddress" class="o-field__label">Follow a new instance</label></div>
|
||||
<div class="o-field__horizontal-body">
|
||||
<div data-oruga="field" class="o-field">
|
||||
<!---->
|
||||
<div class="o-field__body">
|
||||
<div class="o-field">
|
||||
<div data-v-364450c8="" data-oruga="field" class="o-field" expanded="" size="large">
|
||||
<!---->
|
||||
<div class="o-field__body">
|
||||
<div class="o-field o-field--grouped-multiline o-field--grouped">
|
||||
<p data-v-364450c8="" class="control">
|
||||
<div data-v-364450c8="" data-oruga="input" class="o-input__wrapper"><input id="newRelayAddress" data-oruga-input="text" type="text" class="o-input" autocomplete="off" placeholder="Ex: mobilizon.fr">
|
||||
<!---->
|
||||
<!---->
|
||||
<!---->
|
||||
</div>
|
||||
</p>
|
||||
<p data-v-364450c8="" class="control"><button data-v-364450c8="" type="submit" class="o-btn o-btn--primary" role="button" data-oruga="button"><span class="o-btn__wrapper"><!----><span class="o-btn__label">Add an instance</span>
|
||||
<!----></span>
|
||||
</button>
|
||||
<transition-stub data-v-364450c8="" name="fade" appear="false" persisted="false" css="true">
|
||||
<!---->
|
||||
</transition-stub>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<!---->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<p class="o-field__message"></p>
|
||||
</div>
|
||||
</div>
|
||||
<!---->
|
||||
</div>
|
||||
</form>
|
||||
<div data-v-364450c8="" class="flex flex-wrap gap-2">
|
||||
<div data-v-364450c8="" data-oruga="field" class="o-field"><label class="o-field__label">Follow status</label>
|
||||
<div class="o-field__body">
|
||||
<div class="o-field o-field--addons"><label data-v-364450c8="" class="o-radio o-radio--checked" data-oruga="radio" role="radio" aria-checked="true"><input type="radio" data-oruga-input="radio" class="o-radio__input o-radio__input--checked" autocomplete="off" value="ALL"><span class="o-radio__label">All</span></label><label data-v-364450c8="" class="o-radio" data-oruga="radio" role="radio" aria-checked="false"><input type="radio" data-oruga-input="radio" class="o-radio__input" autocomplete="off" value="FOLLOWING"><span class="o-radio__label">Following</span></label><label data-v-364450c8="" class="o-radio" data-oruga="radio" role="radio" aria-checked="false"><input type="radio" data-oruga-input="radio" class="o-radio__input" autocomplete="off" value="FOLLOWED"><span class="o-radio__label">Followed</span></label></div>
|
||||
</div>
|
||||
<!---->
|
||||
</div>
|
||||
<div data-v-364450c8="" data-oruga="field" class="o-field flex-auto"><label for="domain-filter" class="o-field__label">Domain or instance name</label>
|
||||
<div class="o-field__body">
|
||||
<div class="o-field o-field--addons">
|
||||
<div data-v-364450c8="" data-oruga="input" class="o-input__wrapper"><input id="domain-filter" data-oruga-input="text" type="text" class="o-input" autocomplete="off" placeholder="mobilizon-instance.tld">
|
||||
<!---->
|
||||
<!---->
|
||||
<!---->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!---->
|
||||
</div>
|
||||
</div>
|
||||
<div data-v-364450c8="" class="my-3"><a data-v-364450c8="" href="/settings/admin/instances/mobilizon.test" class="min-w-0 flex items-center mb-2 rounded bg-mbz-yellow-alt-300 hover:bg-mbz-yellow-alt-200 dark:bg-mbz-purple-600 dark:hover:bg-mbz-purple-700 p-4 flex-wrap md:flex-nowrap justify-center gap-x-2 gap-y-3">
|
||||
<div data-v-364450c8="" class="flex-1 overflow-hidden flex items-center gap-1"><img data-v-364450c8="" class="w-12" src="/img/logo.svg" alt="">
|
||||
<div data-v-364450c8="" class="">
|
||||
<h3 data-v-364450c8="" class="text-lg truncate font-bold line-clamp-1 text-slate-800 dark:text-slate-100">Mobilizon</h3>
|
||||
<div data-v-364450c8="">
|
||||
<div data-v-364450c8="" class="flex flex-wrap gap-x-2 gap-y-1">
|
||||
<p data-v-364450c8="" class="min-w-0 inline-flex gap-1 truncate text-slate-700 dark:text-slate-300"><span data-v-364450c8="" class="o-icon" data-oruga="icon"><i class="mdi mdi-web mdi-24px"></i></span><span data-v-364450c8="">mobilizon.test</span></p>
|
||||
<p data-v-364450c8="" class="capitalize text-slate-700 dark:text-slate-300 inline-flex gap-1"><span data-v-364450c8="" class="o-icon" data-oruga="icon"><i class="mdi mdi-server mdi-24px"></i></span> Mobilizon</p>
|
||||
</div>
|
||||
<div data-v-364450c8="">
|
||||
<!--v-if-->
|
||||
<!--v-if-->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div data-v-364450c8="" class="flex-none flex gap-3 ltr:ml-3 rtl:mr-3">
|
||||
<p data-v-364450c8="" class="flex flex-col text-center"><span data-v-364450c8="" class="text-xl">20</span><span data-v-364450c8="" class="text-sm">Events</span></p>
|
||||
<p data-v-364450c8="" class="flex flex-col text-center"><span data-v-364450c8="" class="text-xl">5</span><span data-v-364450c8="" class="text-sm">Profiles</span></p>
|
||||
</div>
|
||||
</a><a data-v-364450c8="" href="/settings/admin/instances/agenda.test" class="min-w-0 flex items-center mb-2 rounded bg-mbz-yellow-alt-300 hover:bg-mbz-yellow-alt-200 dark:bg-mbz-purple-600 dark:hover:bg-mbz-purple-700 p-4 flex-wrap md:flex-nowrap justify-center gap-x-2 gap-y-3">
|
||||
<div data-v-364450c8="" class="flex-1 overflow-hidden flex items-center gap-1"><img data-v-364450c8="" class="w-8 mx-2" src="/img/gancio.png" alt="">
|
||||
<div data-v-364450c8="" class="">
|
||||
<h3 data-v-364450c8="" class="text-lg truncate font-bold line-clamp-1 text-slate-800 dark:text-slate-100">Agenda de Crémeaux</h3>
|
||||
<div data-v-364450c8="">
|
||||
<div data-v-364450c8="" class="flex flex-wrap gap-x-2 gap-y-1">
|
||||
<p data-v-364450c8="" class="min-w-0 inline-flex gap-1 truncate text-slate-700 dark:text-slate-300"><span data-v-364450c8="" class="o-icon" data-oruga="icon"><i class="mdi mdi-web mdi-24px"></i></span><span data-v-364450c8="">agenda.test</span></p>
|
||||
<p data-v-364450c8="" class="capitalize text-slate-700 dark:text-slate-300 inline-flex gap-1"><span data-v-364450c8="" class="o-icon" data-oruga="icon"><i class="mdi mdi-server mdi-24px"></i></span> gancio</p>
|
||||
</div>
|
||||
<div data-v-364450c8="">
|
||||
<p data-v-364450c8="" class="inline-flex gap-1 text-slate-700 dark:text-slate-300"><span data-v-364450c8="" class="o-icon" data-oruga="icon"><i class="mdi mdi-inbox-arrow-down mdi-24px"></i></span> Followed</p>
|
||||
<!--v-if-->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div data-v-364450c8="" class="flex-none flex gap-3 ltr:ml-3 rtl:mr-3">
|
||||
<p data-v-364450c8="" class="flex flex-col text-center"><span data-v-364450c8="" class="text-xl">4</span><span data-v-364450c8="" class="text-sm">Events</span></p>
|
||||
<p data-v-364450c8="" class="flex flex-col text-center"><span data-v-364450c8="" class="text-xl">0</span><span data-v-364450c8="" class="text-sm">Profiles</span></p>
|
||||
</div>
|
||||
</a>
|
||||
<nav data-v-364450c8="" class="o-pag o-pag--right" data-oruga="pagination" style="display: none;"><button role="button" tabindex="0" class="o-pag__link o-pag__previous o-pag__link--disabled" aria-label="Previous page" aria-current="false"><span class="o-icon" data-oruga="icon" aria-hidden="true"><i class="mdi mdi-chevron-left mdi-24px"></i></span></button><button role="button" tabindex="0" class="o-pag__link o-pag__next o-pag__link--disabled" aria-label="Next page" aria-current="false"><span class="o-icon" data-oruga="icon" aria-hidden="true"><i class="mdi mdi-chevron-right mdi-24px"></i></span></button>
|
||||
<ul class="o-pag__list">
|
||||
<!---->
|
||||
<!---->
|
||||
<li class="o-pag__item"><button role="button" tabindex="0" class="o-pag__link o-pag__link--current" aria-label="Current page, Page 1." aria-current="true">1</button></li>
|
||||
<!---->
|
||||
<!---->
|
||||
</ul>
|
||||
</nav>
|
||||
</div>
|
||||
</section>
|
||||
</div>"
|
||||
`;
|
||||
@@ -1,115 +0,0 @@
|
||||
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
|
||||
|
||||
exports[`ProfilesView > Show simple 1`] = `
|
||||
"<div data-v-7a3be82f="">
|
||||
<breadcrumbs-nav data-v-7a3be82f="" links="[object Object],[object Object]"></breadcrumbs-nav>
|
||||
<div data-v-7a3be82f="">
|
||||
<div data-v-7a3be82f="" class="flex gap-2"><label data-v-7a3be82f="" class="o-switch o-switch--right" data-oruga="switch" role="switch" aria-checked="true"><input type="checkbox" role="switch" data-oruga-input="switch" class="o-switch__input o-switch__input--checked" autocomplete="off" true-value="true" false-value="false"><span class="o-switch__check o-switch__check--checked o-switch--rounded"><span class="o-switch__check-switch o-switch--rounded"></span></span><span class="o-switch__label">Local</span></label><label data-v-7a3be82f="" class="o-switch o-switch--right" data-oruga="switch" role="switch" aria-checked="false"><input type="checkbox" role="switch" data-oruga-input="switch" class="o-switch__input" autocomplete="off" true-value="true" false-value="false"><span class="o-switch__check o-switch--rounded"><span class="o-switch__check-switch o-switch--rounded"></span></span><span class="o-switch__label">Suspended</span></label></div>
|
||||
<div data-v-7a3be82f="" class="o-table__root" data-oruga="table">
|
||||
<div style="display: none;"><span data-v-7a3be82f="" data-id="1" data-oruga="table-column">Username <!----></span><span data-v-7a3be82f="" data-id="2" data-oruga="table-column">Domain <!----></span></div>
|
||||
<!---->
|
||||
<!---->
|
||||
<div class="o-table__wrapper">
|
||||
<table class="o-table">
|
||||
<!---->
|
||||
<thead>
|
||||
<tr>
|
||||
<!---->
|
||||
<!---->
|
||||
<th class="o-table__th" draggable="false"><span>Username <span class="o-table__th__sort-icon" style="display: none;"><span class="o-icon o-icon--small" data-oruga="icon"><i class="mdi mdi-arrow-up"></i></span></span></span></th>
|
||||
<th class="o-table__th" draggable="false"><span>Domain <span class="o-table__th__sort-icon" style="display: none;"><span class="o-icon o-icon--small" data-oruga="icon"><i class="mdi mdi-arrow-up"></i></span></span></span></th>
|
||||
<!---->
|
||||
</tr>
|
||||
<tr>
|
||||
<!---->
|
||||
<!---->
|
||||
<th class="o-table__th"><span><div data-v-7a3be82f="" data-oruga="input" class="o-input__wrapper"><input aria-label="Filter" id="" data-oruga-input="text" type="text" class="o-input o-input--iconspace-left" autocomplete="off" placeholder="Filter"><span class="o-icon o-input__icon-left" data-oruga="icon"><i class="mdi mdi-magnify mdi-24px"></i></span>
|
||||
<!---->
|
||||
<!---->
|
||||
</div></span></th>
|
||||
<th class="o-table__th"><span><div data-v-7a3be82f="" data-oruga="input" class="o-input__wrapper"><input aria-label="Filter" id="" data-oruga-input="text" type="text" class="o-input o-input--iconspace-left" autocomplete="off" placeholder="Filter"><span class="o-icon o-input__icon-left" data-oruga="icon"><i class="mdi mdi-magnify mdi-24px"></i></span>
|
||||
<!---->
|
||||
<!---->
|
||||
</div></span></th>
|
||||
<!---->
|
||||
</tr>
|
||||
<!---->
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr class="" draggable="false">
|
||||
<!---->
|
||||
<!---->
|
||||
<td class="o-table__td" data-label="Username"><a data-v-7a3be82f="" href="/settings/admin/profiles/1" class="profile">
|
||||
<article data-v-7a3be82f="" class="flex gap-2"><span data-v-7a3be82f="" aria-hidden="true" class="material-design-icon account-icon" role="img"><svg fill="currentColor" class="material-design-icon__svg" width="48" height="48" viewBox="0 0 24 24"><path d="M12,4A4,4 0 0,1 16,8A4,4 0 0,1 12,12A4,4 0 0,1 8,8A4,4 0 0,1 12,4M12,14C16.42,14 20,15.79 20,18V20H4V18C4,15.79 7.58,14 12,14Z"><!--v-if--></path></svg></span>
|
||||
<div data-v-7a3be82f="" class="">
|
||||
<div data-v-7a3be82f="" class="prose dark:prose-invert"><strong data-v-7a3be82f="">Mobilizon Anonymous Actor</strong><br data-v-7a3be82f=""><small data-v-7a3be82f="">@anonymous</small></div>
|
||||
</div>
|
||||
</article>
|
||||
</a></td>
|
||||
<td class="o-table__td" data-label="Domain"></td>
|
||||
<!---->
|
||||
</tr>
|
||||
<transition-stub name="slide" appear="false" persisted="false" css="true">
|
||||
<!---->
|
||||
</transition-stub>
|
||||
<!---->
|
||||
<tr class="" draggable="false">
|
||||
<!---->
|
||||
<!---->
|
||||
<td class="o-table__td" data-label="Username"><a data-v-7a3be82f="" href="/settings/admin/profiles/2" class="profile">
|
||||
<article data-v-7a3be82f="" class="flex gap-2"><span data-v-7a3be82f="" aria-hidden="true" class="material-design-icon account-icon" role="img"><svg fill="currentColor" class="material-design-icon__svg" width="48" height="48" viewBox="0 0 24 24"><path d="M12,4A4,4 0 0,1 16,8A4,4 0 0,1 12,12A4,4 0 0,1 8,8A4,4 0 0,1 12,4M12,14C16.42,14 20,15.79 20,18V20H4V18C4,15.79 7.58,14 12,14Z"><!--v-if--></path></svg></span>
|
||||
<div data-v-7a3be82f="" class="">
|
||||
<div data-v-7a3be82f="" class="prose dark:prose-invert"><strong data-v-7a3be82f="">Mobilizon</strong><br data-v-7a3be82f=""><small data-v-7a3be82f="">@mobilizon</small></div>
|
||||
</div>
|
||||
</article>
|
||||
</a></td>
|
||||
<td class="o-table__td" data-label="Domain"></td>
|
||||
<!---->
|
||||
</tr>
|
||||
<transition-stub name="slide" appear="false" persisted="false" css="true">
|
||||
<!---->
|
||||
</transition-stub>
|
||||
<!---->
|
||||
<tr class="" draggable="false">
|
||||
<!---->
|
||||
<!---->
|
||||
<td class="o-table__td" data-label="Username"><a data-v-7a3be82f="" href="/settings/admin/profiles/109687" class="profile">
|
||||
<article data-v-7a3be82f="" class="flex gap-2"><span data-v-7a3be82f="" aria-hidden="true" class="material-design-icon account-icon" role="img"><svg fill="currentColor" class="material-design-icon__svg" width="48" height="48" viewBox="0 0 24 24"><path d="M12,4A4,4 0 0,1 16,8A4,4 0 0,1 12,12A4,4 0 0,1 8,8A4,4 0 0,1 12,4M12,14C16.42,14 20,15.79 20,18V20H4V18C4,15.79 7.58,14 12,14Z"><!--v-if--></path></svg></span>
|
||||
<div data-v-7a3be82f="" class="">
|
||||
<div data-v-7a3be82f="" class="prose dark:prose-invert"><strong data-v-7a3be82f="">Example</strong><br data-v-7a3be82f=""><small data-v-7a3be82f="">@example</small></div>
|
||||
</div>
|
||||
</article>
|
||||
</a></td>
|
||||
<td class="o-table__td" data-label="Domain"></td>
|
||||
<!---->
|
||||
</tr>
|
||||
<transition-stub name="slide" appear="false" persisted="false" css="true">
|
||||
<!---->
|
||||
</transition-stub>
|
||||
<!---->
|
||||
<!---->
|
||||
</tbody>
|
||||
<!---->
|
||||
</table>
|
||||
<transition-stub name="fade" appear="false" persisted="false" css="true">
|
||||
<!---->
|
||||
</transition-stub>
|
||||
</div>
|
||||
<div class="o-table__pagination" per-page="10" total="3" rounded="false" size="small" simple="false" aria-next-label="Next page" aria-previous-label="Previous page" aria-page-label="Page" aria-current-label="Current page">
|
||||
<div></div>
|
||||
<div>
|
||||
<nav class="o-pag o-pag--right o-pag--small" data-oruga="pagination"><button role="button" tabindex="0" class="o-pag__link o-pag__previous o-pag__link--disabled" aria-label="Previous page" aria-current="false"><span class="o-icon" data-oruga="icon" aria-hidden="true"><i class="mdi mdi-chevron-left mdi-24px"></i></span></button><button role="button" tabindex="0" class="o-pag__link o-pag__next o-pag__link--disabled" aria-label="Next page" aria-current="false"><span class="o-icon" data-oruga="icon" aria-hidden="true"><i class="mdi mdi-chevron-right mdi-24px"></i></span></button>
|
||||
<ul class="o-pag__list">
|
||||
<!---->
|
||||
<!---->
|
||||
<li class="o-pag__item"><button role="button" tabindex="0" class="o-pag__link o-pag__link--current" aria-label="Current page, Page 1." aria-current="true">1</button></li>
|
||||
<!---->
|
||||
<!---->
|
||||
</ul>
|
||||
</nav>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>"
|
||||
`;
|
||||
@@ -1,128 +0,0 @@
|
||||
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
|
||||
|
||||
exports[`SettingsView > Show and save settings 1`] = `
|
||||
"<div data-v-a8bb2abf="">
|
||||
<breadcrumbs-nav data-v-a8bb2abf="" links="[object Object],[object Object]"></breadcrumbs-nav>
|
||||
<div data-v-a8bb2abf="">
|
||||
<form data-v-a8bb2abf="">
|
||||
<section data-v-a8bb2abf="" class="mt-4 mb-4 p-4 border rounded shadow-sm bg-white">
|
||||
<h2 data-v-a8bb2abf="">Informations</h2>
|
||||
<o-field data-v-a8bb2abf="" label="Instance Name" label-for="instance-name">
|
||||
<o-input data-v-a8bb2abf="" modelvalue="Mobilizon.test" id="instance-name" expanded=""></o-input>
|
||||
</o-field>
|
||||
<div data-v-a8bb2abf="" class="field flex flex-col"><label data-v-a8bb2abf="" for="instance-description">Instance Short Description</label><small data-v-a8bb2abf="">Displayed on homepage and meta tags. Describe what Mobilizon is and what makes this instance special in a single paragraph.</small>
|
||||
<o-input data-v-a8bb2abf="" type="textarea" modelvalue="Welcome to Mobilizon" rows="2" id="instance-description"></o-input>
|
||||
</div>
|
||||
<div data-v-a8bb2abf="" class="field flex flex-col"><label data-v-a8bb2abf="" for="instance-long-description">Instance Long Description</label><small data-v-a8bb2abf="">A place to explain who you are and the things that set your instance apart. You can use HTML tags.</small>
|
||||
<o-input data-v-a8bb2abf="" type="textarea" modelvalue="Mobilizon instance." rows="4" id="instance-long-description"></o-input>
|
||||
</div>
|
||||
<div data-v-a8bb2abf="" class="field flex flex-col"><label data-v-a8bb2abf="" for="instance-slogan">Instance Slogan</label><small data-v-a8bb2abf="">A short tagline for your instance homepage. Defaults to "Gather ⋅ Organize ⋅ Mobilize"</small>
|
||||
<o-input data-v-a8bb2abf="" modelvalue="Long life to Mobilizon" placeholder="Gather ⋅ Organize ⋅ Mobilize" id="instance-slogan"></o-input>
|
||||
</div>
|
||||
<div data-v-a8bb2abf="" class="field flex flex-col"><label data-v-a8bb2abf="" for="instance-contact">Contact</label><small data-v-a8bb2abf="">Can be an email or a link, or just plain text.</small>
|
||||
<o-input data-v-a8bb2abf="" modelvalue="info@mobilizon.test" id="instance-contact"></o-input>
|
||||
</div>
|
||||
</section>
|
||||
<section data-v-a8bb2abf="" class="mt-4 mb-4 p-4 border rounded shadow-sm bg-white">
|
||||
<h2 data-v-a8bb2abf="">Pictures</h2><label data-v-a8bb2abf="" class="field flex flex-col">
|
||||
<p data-v-a8bb2abf="">Logo</p><small data-v-a8bb2abf="">Logo of the instance. Defaults to the upstream Mobilizon logo.</small>
|
||||
<picture-upload-stub data-v-a8bb2abf="" textfallback="Logo" accept="image/gif,image/png,image/jpeg,image/webp" maxsize="10485760"></picture-upload-stub>
|
||||
</label><label data-v-a8bb2abf="" class="field flex flex-col">
|
||||
<p data-v-a8bb2abf="">Favicon</p><small data-v-a8bb2abf="">Browser tab icon and PWA icon of the instance. Defaults to the upstream Mobilizon icon.</small>
|
||||
<picture-upload-stub data-v-a8bb2abf="" textfallback="Favicon" accept="image/gif,image/png,image/jpeg,image/webp" maxsize="10485760"></picture-upload-stub>
|
||||
</label><label data-v-a8bb2abf="" class="field flex flex-col">
|
||||
<p data-v-a8bb2abf="">Default Picture</p><small data-v-a8bb2abf="">Default picture when an event or group doesn't have one.</small>
|
||||
<picture-upload-stub data-v-a8bb2abf="" textfallback="Default Picture" accept="image/gif,image/png,image/jpeg,image/webp" maxsize="10485760"></picture-upload-stub>
|
||||
</label>
|
||||
</section>
|
||||
<section data-v-a8bb2abf="" class="mt-4 mb-4 p-4 border rounded shadow-sm bg-white">
|
||||
<h2 data-v-a8bb2abf="">Options</h2>
|
||||
<o-field data-v-a8bb2abf="" label="Allow registrations">
|
||||
<fieldset data-v-a8bb2abf="">
|
||||
<o-field data-v-a8bb2abf="">
|
||||
<o-radio data-v-a8bb2abf="" modelvalue="OPEN" name="registrationsModeType" native-value="CLOSE">Registration is closed.</o-radio>
|
||||
</o-field>
|
||||
<o-field data-v-a8bb2abf="">
|
||||
<o-radio data-v-a8bb2abf="" modelvalue="OPEN" name="registrationsModeType" native-value="OPEN">Registration is allowed, anyone can register.</o-radio>
|
||||
</o-field>
|
||||
<o-field data-v-a8bb2abf="">
|
||||
<o-radio data-v-a8bb2abf="" modelvalue="OPEN" name="registrationsModeType" native-value="MODERATED">Registration is moderated, new user must be validated.</o-radio>
|
||||
</o-field>
|
||||
</fieldset>
|
||||
</o-field>
|
||||
<div data-v-a8bb2abf="" class="field flex flex-col"><label data-v-a8bb2abf="" for="instance-languages">Instance languages</label><small data-v-a8bb2abf="">Main languages you/your moderators speak</small>
|
||||
<o-taginput data-v-a8bb2abf="" modelvalue="" data="" allow-autocomplete="" open-on-focus="true" field="name" icon="label" placeholder="Select languages" id="instance-languages"></o-taginput>
|
||||
</div>
|
||||
</section>
|
||||
<section data-v-a8bb2abf="" class="mt-4 mb-4 p-4 border rounded shadow-sm bg-white">
|
||||
<h2 data-v-a8bb2abf="">Policies</h2>
|
||||
<div data-v-a8bb2abf="" class="field flex flex-col"><label data-v-a8bb2abf="" for="instance-rules">Instance Rules</label><small data-v-a8bb2abf="">A place for your code of conduct, rules or guidelines. You can use HTML tags.</small>
|
||||
<o-input data-v-a8bb2abf="" type="textarea" id="instance-rules"></o-input>
|
||||
</div>
|
||||
<o-field data-v-a8bb2abf="" label="Instance Terms Source">
|
||||
<div data-v-a8bb2abf="">
|
||||
<div data-v-a8bb2abf="">
|
||||
<fieldset data-v-a8bb2abf="">
|
||||
<legend data-v-a8bb2abf="">Choose the source of the instance's Terms</legend>
|
||||
<o-field data-v-a8bb2abf="">
|
||||
<o-radio data-v-a8bb2abf="" modelvalue="DEFAULT" name="instanceTermsType" native-value="DEFAULT">Default Mobilizon terms</o-radio>
|
||||
</o-field>
|
||||
<o-field data-v-a8bb2abf="">
|
||||
<o-radio data-v-a8bb2abf="" modelvalue="DEFAULT" name="instanceTermsType" native-value="URL">Custom URL</o-radio>
|
||||
</o-field>
|
||||
<o-field data-v-a8bb2abf="">
|
||||
<o-radio data-v-a8bb2abf="" modelvalue="DEFAULT" name="instanceTermsType" native-value="CUSTOM">Custom text</o-radio>
|
||||
</o-field>
|
||||
</fieldset>
|
||||
</div>
|
||||
<div data-v-a8bb2abf="">
|
||||
<o-notification data-v-a8bb2abf="" class="bg-slate-700"><b data-v-a8bb2abf="">Default</b>
|
||||
<i18n-t-stub data-v-a8bb2abf="" tag="p" keypath="The {default_terms} will be used. They will be translated in the user's language." scope="parent" class="prose dark:prose-invert"></i18n-t-stub><b data-v-a8bb2abf="">NOTE! The default terms have not been checked over by a lawyer and thus are unlikely to provide full legal protection for all situations for an instance admin using them. They are also not specific to all countries and jurisdictions. If you are unsure, please check with a lawyer.</b>
|
||||
</o-notification>
|
||||
<!--v-if-->
|
||||
<!--v-if-->
|
||||
</div>
|
||||
</div>
|
||||
</o-field>
|
||||
<!--v-if-->
|
||||
<!--v-if-->
|
||||
<o-field data-v-a8bb2abf="" label="Instance Privacy Policy Source">
|
||||
<div data-v-a8bb2abf="">
|
||||
<div data-v-a8bb2abf="">
|
||||
<fieldset data-v-a8bb2abf="">
|
||||
<legend data-v-a8bb2abf="">Choose the source of the instance's Privacy Policy</legend>
|
||||
<o-field data-v-a8bb2abf="">
|
||||
<o-radio data-v-a8bb2abf="" modelvalue="DEFAULT" name="instancePrivacyType" native-value="DEFAULT">Default Mobilizon privacy policy</o-radio>
|
||||
</o-field>
|
||||
<o-field data-v-a8bb2abf="">
|
||||
<o-radio data-v-a8bb2abf="" modelvalue="DEFAULT" name="instancePrivacyType" native-value="URL">Custom URL</o-radio>
|
||||
</o-field>
|
||||
<o-field data-v-a8bb2abf="">
|
||||
<o-radio data-v-a8bb2abf="" modelvalue="DEFAULT" name="instancePrivacyType" native-value="CUSTOM">Custom text</o-radio>
|
||||
</o-field>
|
||||
</fieldset>
|
||||
</div>
|
||||
<div data-v-a8bb2abf="">
|
||||
<div data-v-a8bb2abf="" class="notification"><b data-v-a8bb2abf="">Default</b>
|
||||
<i18n-t-stub data-v-a8bb2abf="" tag="p" keypath="The {default_privacy_policy} will be used. They will be translated in the user's language." scope="parent" class="prose dark:prose-invert"></i18n-t-stub>
|
||||
</div>
|
||||
<!--v-if-->
|
||||
<!--v-if-->
|
||||
</div>
|
||||
</div>
|
||||
</o-field>
|
||||
<!--v-if-->
|
||||
<!--v-if-->
|
||||
</section>
|
||||
<section data-v-a8bb2abf="" class="mt-4 mb-4 p-4 border rounded shadow-sm bg-white">
|
||||
<h2 data-v-a8bb2abf="">External links</h2><small data-v-a8bb2abf="">This section lets you add links to external websites to the menu.</small>
|
||||
<o-field data-v-a8bb2abf="">
|
||||
<o-button data-v-a8bb2abf="" label="Add a new link"></o-button>
|
||||
</o-field>
|
||||
<!--v-if-->
|
||||
</section>
|
||||
<o-button data-v-a8bb2abf="" native-type="submit" variant="primary">Save instance settings</o-button>
|
||||
</form>
|
||||
</div>
|
||||
</div>"
|
||||
`;
|
||||
@@ -1,229 +0,0 @@
|
||||
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
|
||||
|
||||
exports[`UsersView > Show list with moderation 1`] = `
|
||||
"<div data-v-01123d3b="">
|
||||
<breadcrumbs-nav data-v-01123d3b="" links="[object Object],[object Object]"></breadcrumbs-nav>
|
||||
<div data-v-01123d3b="">
|
||||
<form data-v-01123d3b="">
|
||||
<div data-v-01123d3b="" data-oruga="field" class="o-field mb-5">
|
||||
<!---->
|
||||
<div class="o-field__body">
|
||||
<div class="o-field o-field--grouped-multiline o-field--grouped">
|
||||
<p data-v-01123d3b="" class="control mb-3 m-auto"><label data-v-01123d3b="" class="o-chk" data-oruga="checkbox" role="checkbox" aria-checked="false"><input type="checkbox" data-oruga-input="checkbox" class="o-chk__input" autocomplete="off" true-value="true" false-value="false"><span class="o-chk__label">Users pending for moderation</span></label></p>
|
||||
<div data-v-01123d3b="" data-oruga="field" class="o-field" expanded=""><label class="o-field__label" for="">Email</label>
|
||||
<div class="o-field__body">
|
||||
<div class="o-field o-field--addons">
|
||||
<div data-v-01123d3b="" data-oruga="input" class="o-input__wrapper"><input trap-focus="" id="" data-oruga-input="text" type="text" class="o-input o-input--iconspace-left" autocomplete="off"><span class="o-icon o-input__icon-left" data-oruga="icon"><i class="mdi mdi-email mdi-24px"></i></span>
|
||||
<!---->
|
||||
<!---->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!---->
|
||||
</div>
|
||||
<div data-v-01123d3b="" data-oruga="field" class="o-field" expanded=""><label class="o-field__label" for="">IP Address</label>
|
||||
<div class="o-field__body">
|
||||
<div class="o-field o-field--addons">
|
||||
<div data-v-01123d3b="" data-oruga="input" class="o-input__wrapper"><input id="" data-oruga-input="text" type="text" class="o-input o-input--iconspace-left" autocomplete="off"><span class="o-icon o-input__icon-left" data-oruga="icon"><i class="mdi mdi-web mdi-24px"></i></span>
|
||||
<!---->
|
||||
<!---->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!---->
|
||||
</div>
|
||||
<p data-v-01123d3b="" class="control self-end mb-0"><button data-v-01123d3b="" type="button" class="o-btn o-btn--primary" role="button" data-oruga="button"><span class="o-btn__wrapper"><!----><span class="o-btn__label">Filter</span>
|
||||
<!----></span>
|
||||
</button></p>
|
||||
</div>
|
||||
</div>
|
||||
<!---->
|
||||
</div>
|
||||
</form>
|
||||
<div data-v-01123d3b="" class="o-table__root" data-oruga="table">
|
||||
<div style="display: none;"><span data-v-01123d3b="" data-id="1" data-oruga="table-column"> <!----></span><span data-v-01123d3b="" data-id="2" data-oruga="table-column">Email <!----></span><span data-v-01123d3b="" data-id="3" data-oruga="table-column" centered="true">Last seen on <!----></span><span data-v-01123d3b="" data-id="4" data-oruga="table-column" centered="true">Language <!----></span></div>
|
||||
<!---->
|
||||
<!---->
|
||||
<div class="o-table__wrapper">
|
||||
<table class="o-table">
|
||||
<!---->
|
||||
<thead>
|
||||
<tr>
|
||||
<!---->
|
||||
<!---->
|
||||
<th class="o-table__th" style="width: 40px;" draggable="false"><span> <span class="o-table__th__sort-icon" style="display: none;"><span class="o-icon o-icon--small" data-oruga="icon"><i class="mdi mdi-arrow-up"></i></span></span></span></th>
|
||||
<th class="o-table__th" draggable="false"><span>Email <span class="o-table__th__sort-icon" style="display: none;"><span class="o-icon o-icon--small" data-oruga="icon"><i class="mdi mdi-arrow-up"></i></span></span></span></th>
|
||||
<th class="o-table__th" draggable="false"><span>Last seen on <span class="o-table__th__sort-icon" style="display: none;"><span class="o-icon o-icon--small" data-oruga="icon"><i class="mdi mdi-arrow-up"></i></span></span></span></th>
|
||||
<th class="o-table__th" draggable="false"><span>Language <span class="o-table__th__sort-icon" style="display: none;"><span class="o-icon o-icon--small" data-oruga="icon"><i class="mdi mdi-arrow-up"></i></span></span></span></th>
|
||||
<!---->
|
||||
</tr>
|
||||
<!---->
|
||||
<!---->
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr class="" draggable="false">
|
||||
<!---->
|
||||
<!---->
|
||||
<td class="o-table__td" style="width: 40px;">6</td>
|
||||
<td class="o-table__td" data-label="Email"><a data-v-01123d3b="" href="/settings/admin/users/6" class="">truc@mobilizon.test</a></td>
|
||||
<td class="o-table__td" data-label="Last seen on"><time data-v-01123d3b="">Thursday, January 1, 1970 at 1:00 AM</time></td>
|
||||
<td class="o-table__td" data-label="Language">English</td>
|
||||
<!---->
|
||||
</tr>
|
||||
<transition-stub name="slide" appear="false" persisted="false" css="true">
|
||||
<!---->
|
||||
</transition-stub>
|
||||
<!---->
|
||||
<tr class="" draggable="false">
|
||||
<!---->
|
||||
<!---->
|
||||
<td class="o-table__td" style="width: 40px;">1</td>
|
||||
<td class="o-table__td" data-label="Email"><a data-v-01123d3b="" href="/settings/admin/users/1" class="">admin@mobilizon.test</a></td>
|
||||
<td class="o-table__td" data-label="Last seen on"><time data-v-01123d3b="" datetime="2025-09-11T16:10:03Z">Thursday, September 11, 2025 at 6:10 PM</time></td>
|
||||
<td class="o-table__td" data-label="Language">English</td>
|
||||
<!---->
|
||||
</tr>
|
||||
<transition-stub name="slide" appear="false" persisted="false" css="true">
|
||||
<!---->
|
||||
</transition-stub>
|
||||
<!---->
|
||||
<!---->
|
||||
</tbody>
|
||||
<!---->
|
||||
</table>
|
||||
<transition-stub name="fade" appear="false" persisted="false" css="true">
|
||||
<!---->
|
||||
</transition-stub>
|
||||
</div>
|
||||
<div class="o-table__pagination" per-page="10" total="2" rounded="false" size="small" simple="false" aria-next-label="Next page" aria-previous-label="Previous page" aria-page-label="Page" aria-current-label="Current page">
|
||||
<div></div>
|
||||
<div>
|
||||
<nav class="o-pag o-pag--right o-pag--small" data-oruga="pagination"><button role="button" tabindex="0" class="o-pag__link o-pag__previous o-pag__link--disabled" aria-label="Previous page" aria-current="false"><span class="o-icon" data-oruga="icon" aria-hidden="true"><i class="mdi mdi-chevron-left mdi-24px"></i></span></button><button role="button" tabindex="0" class="o-pag__link o-pag__next o-pag__link--disabled" aria-label="Next page" aria-current="false"><span class="o-icon" data-oruga="icon" aria-hidden="true"><i class="mdi mdi-chevron-right mdi-24px"></i></span></button>
|
||||
<ul class="o-pag__list">
|
||||
<!---->
|
||||
<!---->
|
||||
<li class="o-pag__item"><button role="button" tabindex="0" class="o-pag__link o-pag__link--current" aria-label="Current page, Page 1." aria-current="true">1</button></li>
|
||||
<!---->
|
||||
<!---->
|
||||
</ul>
|
||||
</nav>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>"
|
||||
`;
|
||||
|
||||
exports[`UsersView > Show simple list 1`] = `
|
||||
"<div data-v-01123d3b="">
|
||||
<breadcrumbs-nav data-v-01123d3b="" links="[object Object],[object Object]"></breadcrumbs-nav>
|
||||
<div data-v-01123d3b="">
|
||||
<form data-v-01123d3b="">
|
||||
<div data-v-01123d3b="" data-oruga="field" class="o-field mb-5">
|
||||
<!---->
|
||||
<div class="o-field__body">
|
||||
<div class="o-field o-field--grouped-multiline o-field--grouped">
|
||||
<!--v-if-->
|
||||
<div data-v-01123d3b="" data-oruga="field" class="o-field" expanded=""><label class="o-field__label" for="">Email</label>
|
||||
<div class="o-field__body">
|
||||
<div class="o-field o-field--addons">
|
||||
<div data-v-01123d3b="" data-oruga="input" class="o-input__wrapper"><input trap-focus="" id="" data-oruga-input="text" type="text" class="o-input o-input--iconspace-left" autocomplete="off"><span class="o-icon o-input__icon-left" data-oruga="icon"><i class="mdi mdi-email mdi-24px"></i></span>
|
||||
<!---->
|
||||
<!---->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!---->
|
||||
</div>
|
||||
<div data-v-01123d3b="" data-oruga="field" class="o-field" expanded=""><label class="o-field__label" for="">IP Address</label>
|
||||
<div class="o-field__body">
|
||||
<div class="o-field o-field--addons">
|
||||
<div data-v-01123d3b="" data-oruga="input" class="o-input__wrapper"><input id="" data-oruga-input="text" type="text" class="o-input o-input--iconspace-left" autocomplete="off"><span class="o-icon o-input__icon-left" data-oruga="icon"><i class="mdi mdi-web mdi-24px"></i></span>
|
||||
<!---->
|
||||
<!---->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!---->
|
||||
</div>
|
||||
<p data-v-01123d3b="" class="control self-end mb-0"><button data-v-01123d3b="" type="button" class="o-btn o-btn--primary" role="button" data-oruga="button"><span class="o-btn__wrapper"><!----><span class="o-btn__label">Filter</span>
|
||||
<!----></span>
|
||||
</button></p>
|
||||
</div>
|
||||
</div>
|
||||
<!---->
|
||||
</div>
|
||||
</form>
|
||||
<div data-v-01123d3b="" class="o-table__root" data-oruga="table">
|
||||
<div style="display: none;"><span data-v-01123d3b="" data-id="1" data-oruga="table-column"> <!----></span><span data-v-01123d3b="" data-id="2" data-oruga="table-column">Email <!----></span><span data-v-01123d3b="" data-id="3" data-oruga="table-column" centered="true">Last seen on <!----></span><span data-v-01123d3b="" data-id="4" data-oruga="table-column" centered="true">Language <!----></span></div>
|
||||
<!---->
|
||||
<!---->
|
||||
<div class="o-table__wrapper">
|
||||
<table class="o-table">
|
||||
<!---->
|
||||
<thead>
|
||||
<tr>
|
||||
<!---->
|
||||
<!---->
|
||||
<th class="o-table__th" style="width: 40px;" draggable="false"><span> <span class="o-table__th__sort-icon" style="display: none;"><span class="o-icon o-icon--small" data-oruga="icon"><i class="mdi mdi-arrow-up"></i></span></span></span></th>
|
||||
<th class="o-table__th" draggable="false"><span>Email <span class="o-table__th__sort-icon" style="display: none;"><span class="o-icon o-icon--small" data-oruga="icon"><i class="mdi mdi-arrow-up"></i></span></span></span></th>
|
||||
<th class="o-table__th" draggable="false"><span>Last seen on <span class="o-table__th__sort-icon" style="display: none;"><span class="o-icon o-icon--small" data-oruga="icon"><i class="mdi mdi-arrow-up"></i></span></span></span></th>
|
||||
<th class="o-table__th" draggable="false"><span>Language <span class="o-table__th__sort-icon" style="display: none;"><span class="o-icon o-icon--small" data-oruga="icon"><i class="mdi mdi-arrow-up"></i></span></span></span></th>
|
||||
<!---->
|
||||
</tr>
|
||||
<!---->
|
||||
<!---->
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr class="" draggable="false">
|
||||
<!---->
|
||||
<!---->
|
||||
<td class="o-table__td" style="width: 40px;">6</td>
|
||||
<td class="o-table__td" data-label="Email"><a data-v-01123d3b="" href="/settings/admin/users/6" class="">truc@mobilizon.test</a></td>
|
||||
<td class="o-table__td" data-label="Last seen on"><time data-v-01123d3b="">Thursday, January 1, 1970 at 1:00 AM</time></td>
|
||||
<td class="o-table__td" data-label="Language">English</td>
|
||||
<!---->
|
||||
</tr>
|
||||
<transition-stub name="slide" appear="false" persisted="false" css="true">
|
||||
<!---->
|
||||
</transition-stub>
|
||||
<!---->
|
||||
<tr class="" draggable="false">
|
||||
<!---->
|
||||
<!---->
|
||||
<td class="o-table__td" style="width: 40px;">1</td>
|
||||
<td class="o-table__td" data-label="Email"><a data-v-01123d3b="" href="/settings/admin/users/1" class="">admin@mobilizon.test</a></td>
|
||||
<td class="o-table__td" data-label="Last seen on"><time data-v-01123d3b="" datetime="2025-09-11T16:10:03Z">Thursday, September 11, 2025 at 6:10 PM</time></td>
|
||||
<td class="o-table__td" data-label="Language">English</td>
|
||||
<!---->
|
||||
</tr>
|
||||
<transition-stub name="slide" appear="false" persisted="false" css="true">
|
||||
<!---->
|
||||
</transition-stub>
|
||||
<!---->
|
||||
<!---->
|
||||
</tbody>
|
||||
<!---->
|
||||
</table>
|
||||
<transition-stub name="fade" appear="false" persisted="false" css="true">
|
||||
<!---->
|
||||
</transition-stub>
|
||||
</div>
|
||||
<div class="o-table__pagination" per-page="10" total="2" rounded="false" size="small" simple="false" aria-next-label="Next page" aria-previous-label="Previous page" aria-page-label="Page" aria-current-label="Current page">
|
||||
<div></div>
|
||||
<div>
|
||||
<nav class="o-pag o-pag--right o-pag--small" data-oruga="pagination"><button role="button" tabindex="0" class="o-pag__link o-pag__previous o-pag__link--disabled" aria-label="Previous page" aria-current="false"><span class="o-icon" data-oruga="icon" aria-hidden="true"><i class="mdi mdi-chevron-left mdi-24px"></i></span></button><button role="button" tabindex="0" class="o-pag__link o-pag__next o-pag__link--disabled" aria-label="Next page" aria-current="false"><span class="o-icon" data-oruga="icon" aria-hidden="true"><i class="mdi mdi-chevron-right mdi-24px"></i></span></button>
|
||||
<ul class="o-pag__list">
|
||||
<!---->
|
||||
<!---->
|
||||
<li class="o-pag__item"><button role="button" tabindex="0" class="o-pag__link o-pag__link--current" aria-label="Current page, Page 1." aria-current="true">1</button></li>
|
||||
<!---->
|
||||
<!---->
|
||||
</ul>
|
||||
</nav>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>"
|
||||
`;
|
||||
@@ -1,150 +0,0 @@
|
||||
import { beforeEach, describe, it, expect } from "vitest";
|
||||
import { enUS } from "date-fns/locale";
|
||||
import { routes } from "@/router";
|
||||
import { createRouter, createWebHistory, Router } from "vue-router";
|
||||
import { GET_GROUP, REFRESH_PROFILE } from "@/graphql/group";
|
||||
import { SUSPEND_PROFILE, UNSUSPEND_PROFILE } from "@/graphql/actor";
|
||||
import { getMockClient, requestHandlers } from "../../mocks/client";
|
||||
import AdminGroupProfile from "@/views/Admin/AdminGroupProfile.vue";
|
||||
import { config, mount } from "@vue/test-utils";
|
||||
import { Oruga } from "@oruga-ui/oruga-next";
|
||||
import flushPromises from "flush-promises";
|
||||
import { dialogPlugin } from "@/plugins/dialog";
|
||||
import { notifierPlugin } from "@/plugins/notifier";
|
||||
|
||||
config.global.plugins.push(Oruga);
|
||||
config.global.plugins.push(dialogPlugin);
|
||||
config.global.plugins.push(notifierPlugin);
|
||||
|
||||
let router: Router;
|
||||
|
||||
beforeEach(async () => {
|
||||
router = createRouter({
|
||||
history: createWebHistory(),
|
||||
routes: routes,
|
||||
});
|
||||
|
||||
// await router.isReady();
|
||||
});
|
||||
|
||||
const generateWrapper = (group_mock: any = {}) => {
|
||||
const global_data = getMockClient([
|
||||
[GET_GROUP, group_mock],
|
||||
REFRESH_PROFILE,
|
||||
SUSPEND_PROFILE,
|
||||
UNSUSPEND_PROFILE,
|
||||
]);
|
||||
global_data.provide.dateFnsLocale = enUS;
|
||||
global_data.plugins = [router];
|
||||
return mount(AdminGroupProfile, {
|
||||
props: {
|
||||
id: "123456",
|
||||
},
|
||||
global: {
|
||||
...global_data,
|
||||
stubs: {
|
||||
RouterLink: false,
|
||||
},
|
||||
},
|
||||
});
|
||||
};
|
||||
|
||||
const group_mock = {
|
||||
data: {
|
||||
getGroup: {
|
||||
__typename: "Group",
|
||||
avatar: null,
|
||||
banner: null,
|
||||
domain: "domain",
|
||||
id: "1125368",
|
||||
manuallyApprovesFollowers: false,
|
||||
mediaSize: 0,
|
||||
members: {
|
||||
__typename: "PaginatedMemberList",
|
||||
elements: [
|
||||
{
|
||||
__typename: "Member",
|
||||
actor: {
|
||||
__typename: "Person",
|
||||
avatar: null,
|
||||
domain: null,
|
||||
id: "6548012",
|
||||
name: "member #1",
|
||||
preferredUsername: "member_1",
|
||||
summary: "member #1",
|
||||
type: "PERSON",
|
||||
url: "https://mobilizon.test/@member_1",
|
||||
},
|
||||
id: "3d70f3c8-050f-49dd-b7fe-9bb4398225c8",
|
||||
insertedAt: "2021-06-13T09:24:47",
|
||||
role: "ADMINISTRATOR",
|
||||
},
|
||||
],
|
||||
total: 1,
|
||||
},
|
||||
name: "Group name",
|
||||
openness: "INVITE_ONLY",
|
||||
organizedEvents: {
|
||||
__typename: "PaginatedEventList",
|
||||
elements: [],
|
||||
total: 30410,
|
||||
},
|
||||
physicalAddress: null,
|
||||
posts: {
|
||||
__typename: "PaginatedPostList",
|
||||
elements: [],
|
||||
total: 0,
|
||||
},
|
||||
preferredUsername: "group_name",
|
||||
resources: {
|
||||
__typename: "PaginatedResourceList",
|
||||
elements: [],
|
||||
total: 0,
|
||||
},
|
||||
summary: null,
|
||||
suspended: false,
|
||||
todoLists: {
|
||||
__typename: "PaginatedTodoListList",
|
||||
elements: [],
|
||||
total: 0,
|
||||
},
|
||||
type: "GROUP",
|
||||
url: "https://mobilizon.test/@group_name",
|
||||
visibility: "PUBLIC",
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
describe("AdminGroupProfile", () => {
|
||||
it("Show simple", async () => {
|
||||
const wrapper = generateWrapper(group_mock);
|
||||
await wrapper.vm.$nextTick();
|
||||
await flushPromises();
|
||||
expect(wrapper.html()).toMatchSnapshot();
|
||||
expect(requestHandlers.handle_0).toHaveBeenCalledTimes(1);
|
||||
expect(requestHandlers.handle_1).toHaveBeenCalledTimes(0);
|
||||
expect(requestHandlers.handle_2).toHaveBeenCalledTimes(0);
|
||||
expect(requestHandlers.handle_3).toHaveBeenCalledTimes(0);
|
||||
expect(requestHandlers.handle_0).toHaveBeenCalledWith({
|
||||
id: "123456",
|
||||
membersLimit: 10,
|
||||
membersPage: 1,
|
||||
organizedEventsLimit: 10,
|
||||
organizedEventsPage: 1,
|
||||
postsLimit: 10,
|
||||
postsPage: 1,
|
||||
});
|
||||
|
||||
wrapper.find('button[type="button"]').trigger("click");
|
||||
await flushPromises();
|
||||
wrapper.vm.suspendProfile({ id: "12346" });
|
||||
await flushPromises();
|
||||
expect(requestHandlers.handle_0).toHaveBeenCalledTimes(1);
|
||||
expect(requestHandlers.handle_1).toHaveBeenCalledTimes(0);
|
||||
expect(requestHandlers.handle_2).toHaveBeenCalledTimes(1);
|
||||
expect(requestHandlers.handle_3).toHaveBeenCalledTimes(0);
|
||||
expect(requestHandlers.handle_2).toHaveBeenCalledWith({
|
||||
id: "12346",
|
||||
});
|
||||
});
|
||||
});
|
||||
@@ -1,114 +0,0 @@
|
||||
import { beforeEach, describe, it, expect } from "vitest";
|
||||
import { enUS } from "date-fns/locale";
|
||||
import { routes } from "@/router";
|
||||
import { createRouter, createWebHistory, Router } from "vue-router";
|
||||
import { getMockClient, requestHandlers } from "../../mocks/client";
|
||||
import AdminProfile from "@/views/Admin/AdminProfile.vue";
|
||||
import { config, mount } from "@vue/test-utils";
|
||||
import { Oruga } from "@oruga-ui/oruga-next";
|
||||
import flushPromises from "flush-promises";
|
||||
import {
|
||||
GET_PERSON,
|
||||
SUSPEND_PROFILE,
|
||||
UNSUSPEND_PROFILE,
|
||||
} from "@/graphql/actor";
|
||||
|
||||
config.global.plugins.push(Oruga);
|
||||
|
||||
let router: Router;
|
||||
|
||||
beforeEach(async () => {
|
||||
router = createRouter({
|
||||
history: createWebHistory(),
|
||||
routes: routes,
|
||||
});
|
||||
|
||||
// await router.isReady();
|
||||
});
|
||||
|
||||
const person_mock = {
|
||||
data: {
|
||||
person: {
|
||||
__typename: "Person",
|
||||
avatar: null,
|
||||
banner: null,
|
||||
domain: null,
|
||||
feedTokens: [
|
||||
{
|
||||
__typename: "FeedToken",
|
||||
token: "Se4rSUMzeX8KMC4bz7Yybq",
|
||||
},
|
||||
],
|
||||
id: "2",
|
||||
mediaSize: 0,
|
||||
memberships: {
|
||||
__typename: "PaginatedMemberList",
|
||||
elements: [],
|
||||
total: 0,
|
||||
},
|
||||
name: "CurrentPerson",
|
||||
organizedEvents: {
|
||||
__typename: "PaginatedEventList",
|
||||
elements: [],
|
||||
total: 0,
|
||||
},
|
||||
participations: {
|
||||
__typename: "PaginatedParticipantList",
|
||||
elements: [],
|
||||
total: 0,
|
||||
},
|
||||
preferredUsername: "current",
|
||||
summary: null,
|
||||
suspended: false,
|
||||
type: "PERSON",
|
||||
url: "https://mobilizon.test/@current",
|
||||
user: {
|
||||
__typename: "User",
|
||||
email: "current@mobilizon.test",
|
||||
id: "1",
|
||||
},
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
const generateWrapper = (mock_person: any = {}) => {
|
||||
const global_data = getMockClient([
|
||||
[GET_PERSON, mock_person],
|
||||
SUSPEND_PROFILE,
|
||||
UNSUSPEND_PROFILE,
|
||||
]);
|
||||
global_data.provide.dateFnsLocale = enUS;
|
||||
global_data.plugins = [router];
|
||||
return mount(AdminProfile, {
|
||||
props: {
|
||||
id: "987654",
|
||||
},
|
||||
global: {
|
||||
...global_data,
|
||||
stubs: {
|
||||
RouterLink: false,
|
||||
},
|
||||
},
|
||||
});
|
||||
};
|
||||
|
||||
describe("AdminProfile", () => {
|
||||
it("Show simple", async () => {
|
||||
const wrapper = generateWrapper(person_mock);
|
||||
await wrapper.vm.$nextTick();
|
||||
await flushPromises();
|
||||
expect(wrapper.html()).toMatchSnapshot();
|
||||
expect(requestHandlers.handle_0).toHaveBeenCalledTimes(1);
|
||||
expect(requestHandlers.handle_1).toHaveBeenCalledTimes(0);
|
||||
expect(requestHandlers.handle_2).toHaveBeenCalledTimes(0);
|
||||
expect(requestHandlers.handle_0).toHaveBeenCalledWith({
|
||||
actorId: "987654",
|
||||
membershipsLimit: 10,
|
||||
membershipsPage: 1,
|
||||
organizedEventsLimit: 10,
|
||||
organizedEventsPage: 1,
|
||||
participationLimit: 10,
|
||||
participationsPage: 1,
|
||||
});
|
||||
});
|
||||
});
|
||||
@@ -1,269 +0,0 @@
|
||||
import { describe, it, expect, vi, beforeEach } from "vitest";
|
||||
import { DefaultApolloClient } from "@vue/apollo-composable";
|
||||
import { config, mount } from "@vue/test-utils";
|
||||
import buildCurrentUserResolver from "@/apollo/user";
|
||||
import flushPromises from "flush-promises";
|
||||
import { cache } from "@/apollo/memory";
|
||||
import {
|
||||
createMockClient,
|
||||
MockApolloClient,
|
||||
RequestHandler,
|
||||
} from "mock-apollo-client";
|
||||
import AdminUserProfile from "@/views/Admin/AdminUserProfile.vue";
|
||||
import {
|
||||
DELETE_ACCOUNT_AS_MODERATOR,
|
||||
GET_USER,
|
||||
UNBAN_ACCOUNT_AS_MODERATOR,
|
||||
} from "@/graphql/user";
|
||||
import { ADMIN_UPDATE_USER, LANGUAGES_CODES } from "@/graphql/admin";
|
||||
import { Oruga } from "@oruga-ui/oruga-next";
|
||||
import { htmlRemoveId, nullMock } from "../../common";
|
||||
import {
|
||||
createRouterMock,
|
||||
injectRouterMock,
|
||||
VueRouterMock,
|
||||
} from "vue-router-mock";
|
||||
|
||||
let mockClient: MockApolloClient | null;
|
||||
let requestHandlers: Record<string, RequestHandler>;
|
||||
|
||||
const languageCodeMock = {
|
||||
data: {
|
||||
languages: [
|
||||
{
|
||||
__typename: "Language",
|
||||
code: "fr",
|
||||
name: "French",
|
||||
},
|
||||
{
|
||||
__typename: "Language",
|
||||
code: "en",
|
||||
name: "English",
|
||||
},
|
||||
],
|
||||
},
|
||||
};
|
||||
|
||||
const getUserMock = {
|
||||
data: {
|
||||
user: {
|
||||
__typename: "User",
|
||||
actors: [
|
||||
{
|
||||
__typename: "Person",
|
||||
avatar: null,
|
||||
domain: null,
|
||||
id: "11371",
|
||||
name: "Truc",
|
||||
preferredUsername: "truc",
|
||||
summary: null,
|
||||
type: "PERSON",
|
||||
url: "http://mobilizon.test/@truc",
|
||||
},
|
||||
],
|
||||
moderation: "moderation text",
|
||||
confirmedAt: "2025-08-30T09:56:59Z",
|
||||
currentSignInAt: null,
|
||||
currentSignInIp: null,
|
||||
disabled: false,
|
||||
email: "truc@mobilizon.test",
|
||||
id: "1234",
|
||||
lastSignInAt: "2025-08-28T12:33:03Z",
|
||||
lastSignInIp: "176.171.166.30",
|
||||
locale: "fr",
|
||||
mediaSize: 7093555,
|
||||
participations: {
|
||||
__typename: "PaginatedParticipantList",
|
||||
total: 14,
|
||||
},
|
||||
role: "USER",
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
// A copy of the user that is banned
|
||||
const getUserMockBan = structuredClone(getUserMock);
|
||||
getUserMockBan.data.user.disabled = true;
|
||||
|
||||
const getModerateMock = {
|
||||
data: {
|
||||
user: {
|
||||
__typename: "User",
|
||||
actors: [
|
||||
{
|
||||
__typename: "Person",
|
||||
avatar: null,
|
||||
domain: null,
|
||||
id: "11371",
|
||||
name: "Truc",
|
||||
preferredUsername: "truc",
|
||||
summary: null,
|
||||
type: "PERSON",
|
||||
url: "http://mobilizon.test/@truc",
|
||||
},
|
||||
],
|
||||
moderation: "moderation text",
|
||||
confirmedAt: "2025-08-30T09:56:59Z",
|
||||
currentSignInAt: null,
|
||||
currentSignInIp: null,
|
||||
disabled: false,
|
||||
email: "truc@mobilizon.test",
|
||||
id: "1234",
|
||||
lastSignInAt: "2025-08-28T12:33:03Z",
|
||||
lastSignInIp: "176.171.166.30",
|
||||
locale: "fr",
|
||||
mediaSize: 7093555,
|
||||
participations: {
|
||||
__typename: "PaginatedParticipantList",
|
||||
total: 14,
|
||||
},
|
||||
role: "PENDING",
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
config.global.plugins.push(Oruga);
|
||||
config.plugins.VueWrapper.install(VueRouterMock);
|
||||
|
||||
describe("UsersView", () => {
|
||||
const router = createRouterMock({
|
||||
spy: {
|
||||
create: (fn) => vi.fn(fn),
|
||||
reset: (spy) => spy.mockReset(),
|
||||
},
|
||||
});
|
||||
beforeEach(async () => {
|
||||
// await router.isReady();
|
||||
injectRouterMock(router);
|
||||
});
|
||||
|
||||
const generateWrapper = (currentUserMock = getUserMock) => {
|
||||
mockClient = createMockClient({
|
||||
cache,
|
||||
resolvers: buildCurrentUserResolver(cache),
|
||||
});
|
||||
requestHandlers = {
|
||||
languagecode: vi.fn().mockResolvedValue(languageCodeMock),
|
||||
get_user: vi.fn().mockResolvedValue(currentUserMock),
|
||||
update_user: vi.fn().mockResolvedValue(nullMock),
|
||||
ban_user: vi.fn().mockResolvedValue(nullMock),
|
||||
unban_user: vi.fn().mockResolvedValue(nullMock),
|
||||
};
|
||||
mockClient.setRequestHandler(LANGUAGES_CODES, requestHandlers.languagecode);
|
||||
mockClient.setRequestHandler(GET_USER, requestHandlers.get_user);
|
||||
mockClient.setRequestHandler(
|
||||
ADMIN_UPDATE_USER,
|
||||
requestHandlers.update_user
|
||||
);
|
||||
mockClient.setRequestHandler(
|
||||
DELETE_ACCOUNT_AS_MODERATOR,
|
||||
requestHandlers.ban_user
|
||||
);
|
||||
mockClient.setRequestHandler(
|
||||
UNBAN_ACCOUNT_AS_MODERATOR,
|
||||
requestHandlers.unban_user
|
||||
);
|
||||
|
||||
const wrapper = mount(AdminUserProfile, {
|
||||
props: { id: "1234" },
|
||||
stubs: ["router-link", "router-view"],
|
||||
global: {
|
||||
provide: {
|
||||
[DefaultApolloClient]: mockClient,
|
||||
},
|
||||
},
|
||||
});
|
||||
return wrapper;
|
||||
};
|
||||
|
||||
it("Show simple list", async () => {
|
||||
const wrapper = generateWrapper();
|
||||
await wrapper.vm.$nextTick();
|
||||
await flushPromises();
|
||||
expect(wrapper.exists()).toBe(true);
|
||||
expect(htmlRemoveId(wrapper.html())).toMatchSnapshot();
|
||||
expect(requestHandlers.languagecode).toHaveBeenCalledTimes(1);
|
||||
expect(requestHandlers.get_user).toHaveBeenCalledTimes(1);
|
||||
expect(requestHandlers.update_user).toHaveBeenCalledTimes(0);
|
||||
});
|
||||
|
||||
it("Show moderate list", async () => {
|
||||
const wrapper = generateWrapper(getModerateMock);
|
||||
expect(wrapper.router).toBe(router);
|
||||
wrapper.router.push.mockReset();
|
||||
await wrapper.vm.$nextTick();
|
||||
await flushPromises();
|
||||
expect(wrapper.exists()).toBe(true);
|
||||
expect(htmlRemoveId(wrapper.html())).toMatchSnapshot();
|
||||
expect(requestHandlers.languagecode).toHaveBeenCalledTimes(0);
|
||||
expect(requestHandlers.get_user).toHaveBeenCalledTimes(1);
|
||||
expect(requestHandlers.update_user).toHaveBeenCalledTimes(0);
|
||||
const btn = wrapper.find("#acceptAccount");
|
||||
expect(btn.exists()).toBe(true);
|
||||
btn.trigger("click");
|
||||
await flushPromises();
|
||||
expect(requestHandlers.languagecode).toHaveBeenCalledTimes(0);
|
||||
// The user is refreshed after the update
|
||||
expect(requestHandlers.get_user).toHaveBeenCalledTimes(2);
|
||||
expect(requestHandlers.update_user).toHaveBeenCalledTimes(1);
|
||||
expect(requestHandlers.update_user).toHaveBeenCalledWith({
|
||||
id: "1234",
|
||||
notify: true,
|
||||
role: "USER",
|
||||
});
|
||||
});
|
||||
|
||||
it("Ban user", async () => {
|
||||
const wrapper = generateWrapper();
|
||||
await wrapper.vm.$nextTick();
|
||||
await flushPromises();
|
||||
expect(wrapper.exists()).toBe(true);
|
||||
expect(htmlRemoveId(wrapper.html())).toMatchSnapshot();
|
||||
expect(requestHandlers.get_user).toHaveBeenCalledTimes(1);
|
||||
expect(requestHandlers.ban_user).toHaveBeenCalledTimes(0);
|
||||
|
||||
// Find ban button
|
||||
const btn = wrapper.find("#deleteAccount");
|
||||
expect(btn.exists()).toBe(true);
|
||||
btn.trigger("click");
|
||||
|
||||
// TODO The definitive button "Ban the account" is in a dialog pop-up outside of the component
|
||||
// Sadly, we can't access this pop-up and click on the button to fully test
|
||||
/*
|
||||
// ban_user has been called
|
||||
expect(requestHandlers.ban_user).toHaveBeenCalledTimes(1);
|
||||
expect(requestHandlers.get_user).toHaveBeenCalledTimes(2);
|
||||
expect(requestHandlers.ban_user).toHaveBeenCalledWith({
|
||||
userId: "1234",
|
||||
});
|
||||
*/
|
||||
});
|
||||
|
||||
it("Unban user", async () => {
|
||||
const wrapper = generateWrapper(getUserMockBan);
|
||||
await wrapper.vm.$nextTick();
|
||||
await flushPromises();
|
||||
expect(wrapper.exists()).toBe(true);
|
||||
expect(htmlRemoveId(wrapper.html())).toMatchSnapshot();
|
||||
expect(requestHandlers.get_user).toHaveBeenCalledTimes(1);
|
||||
expect(requestHandlers.ban_user).toHaveBeenCalledTimes(0);
|
||||
expect(requestHandlers.unban_user).toHaveBeenCalledTimes(0);
|
||||
|
||||
// Find ban button
|
||||
const btn = wrapper.find("#unbanAccount");
|
||||
expect(btn.exists()).toBe(true);
|
||||
btn.trigger("click");
|
||||
|
||||
// TODO The definitive button "Unban the account" is in a dialog pop-up outside of the component
|
||||
// Sadly, we can't access this pop-up and click on the button to fully test
|
||||
/*
|
||||
// unban_user has been called
|
||||
expect(requestHandlers.get_user).toHaveBeenCalledTimes(2);
|
||||
expect(requestHandlers.ban_user).toHaveBeenCalledTimes(0);
|
||||
expect(requestHandlers.unban_user).toHaveBeenCalledTimes(1);
|
||||
expect(requestHandlers.ban_user).toHaveBeenCalledWith({
|
||||
userId: "1234",
|
||||
});
|
||||
*/
|
||||
});
|
||||
});
|
||||
@@ -1,129 +0,0 @@
|
||||
import { beforeEach, describe, it, expect } from "vitest";
|
||||
import { enUS } from "date-fns/locale";
|
||||
import { routes } from "@/router";
|
||||
import { createRouter, createWebHistory, Router } from "vue-router";
|
||||
import { getMockClient, requestHandlers } from "../../mocks/client";
|
||||
import DashboardView from "@/views/Admin/DashboardView.vue";
|
||||
import { config, shallowMount } from "@vue/test-utils";
|
||||
import { Oruga } from "@oruga-ui/oruga-next";
|
||||
import flushPromises from "flush-promises";
|
||||
import { DASHBOARD } from "@/graphql/admin";
|
||||
|
||||
config.global.plugins.push(Oruga);
|
||||
|
||||
let router: Router;
|
||||
|
||||
beforeEach(async () => {
|
||||
router = createRouter({
|
||||
history: createWebHistory(),
|
||||
routes: routes,
|
||||
});
|
||||
|
||||
// await router.isReady();
|
||||
});
|
||||
|
||||
const dashboard_mock = {
|
||||
data: {
|
||||
dashboard: {
|
||||
__typename: "Dashboard",
|
||||
lastGroupCreated: {
|
||||
__typename: "Group",
|
||||
avatar: null,
|
||||
domain: null,
|
||||
id: "1125368",
|
||||
name: "lastGroup",
|
||||
preferredUsername: "lastgroup",
|
||||
summary: null,
|
||||
type: "GROUP",
|
||||
url: "https://mobilizon.test/@lastGroup",
|
||||
},
|
||||
lastPublicEventPublished: {
|
||||
__typename: "Event",
|
||||
attributedTo: {
|
||||
__typename: "Group",
|
||||
avatar: null,
|
||||
domain: null,
|
||||
id: "1125368",
|
||||
name: "lastGroup",
|
||||
preferredUsername: "lastgroup",
|
||||
summary: null,
|
||||
type: "GROUP",
|
||||
url: "https://mobilizon.test/@lastGroup",
|
||||
},
|
||||
beginsOn: "2026-04-28T15:00:00Z",
|
||||
id: "2675674",
|
||||
options: {
|
||||
__typename: "EventOptions",
|
||||
anonymousParticipation: false,
|
||||
attendees: null,
|
||||
commentModeration: "CLOSED",
|
||||
hideNumberOfParticipants: false,
|
||||
hideOrganizerWhenGroupEvent: false,
|
||||
isOnline: false,
|
||||
maximumAttendeeCapacity: null,
|
||||
offers: [],
|
||||
participationConditions: null,
|
||||
program: null,
|
||||
remainingAttendeeCapacity: null,
|
||||
showEndTime: true,
|
||||
showParticipationPrice: null,
|
||||
showRemainingAttendeeCapacity: null,
|
||||
showStartTime: true,
|
||||
timezone: "Europe/Paris",
|
||||
},
|
||||
organizerActor: {
|
||||
__typename: "Person",
|
||||
avatar: null,
|
||||
domain: null,
|
||||
id: "109687",
|
||||
name: "organizer",
|
||||
preferredUsername: "organizer",
|
||||
summary: "Organizer",
|
||||
type: "PERSON",
|
||||
url: "https://mobilizion.test/@organizer",
|
||||
},
|
||||
picture: {
|
||||
__typename: "Media",
|
||||
alt: null,
|
||||
url: "https://mobilizion.test/media/f57a2cfc8c959b0dafc94c0eed74ad8f7050844ce1c9147fcdb58dd2ac709cde.webp?name=Market.webp",
|
||||
uuid: "1416f0ff-826d-44ba-94c7-e81b29095f87",
|
||||
},
|
||||
title: "Last event very nice",
|
||||
uuid: "76600bf1-b870-4577-9941-1072ebdcd753",
|
||||
},
|
||||
numberOfComments: 5,
|
||||
numberOfConfirmedParticipationsToLocalEvents: 23,
|
||||
numberOfEvents: 340,
|
||||
numberOfFollowers: 12,
|
||||
numberOfFollowings: 35,
|
||||
numberOfGroups: 67,
|
||||
numberOfReports: 9,
|
||||
numberOfUsers: 220,
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
const generateWrapper = (mock_dashboard = {}) => {
|
||||
const global_data = getMockClient([[DASHBOARD, mock_dashboard]]);
|
||||
global_data.provide.dateFnsLocale = enUS;
|
||||
global_data.plugins = [router];
|
||||
return shallowMount(DashboardView, {
|
||||
global: {
|
||||
...global_data,
|
||||
stubs: {
|
||||
RouterLink: false,
|
||||
},
|
||||
},
|
||||
});
|
||||
};
|
||||
|
||||
describe("Dashboard", () => {
|
||||
it("Show simple", async () => {
|
||||
const wrapper = generateWrapper(dashboard_mock);
|
||||
await wrapper.vm.$nextTick();
|
||||
await flushPromises();
|
||||
expect(wrapper.html()).toMatchSnapshot();
|
||||
expect(requestHandlers.handle_0).toHaveBeenCalledTimes(1);
|
||||
expect(requestHandlers.handle_0).toHaveBeenCalledWith({});
|
||||
});
|
||||
});
|
||||
@@ -1,122 +0,0 @@
|
||||
import { beforeEach, describe, it, expect } from "vitest";
|
||||
import { enUS } from "date-fns/locale";
|
||||
import { routes } from "@/router";
|
||||
import { createRouter, createWebHistory, Router } from "vue-router";
|
||||
import { getMockClient, requestHandlers } from "../../mocks/client";
|
||||
import GroupProfiles from "@/views/Admin/GroupProfiles.vue";
|
||||
import { config, mount } from "@vue/test-utils";
|
||||
import { Oruga } from "@oruga-ui/oruga-next";
|
||||
import flushPromises from "flush-promises";
|
||||
import { LIST_GROUPS } from "@/graphql/group";
|
||||
import { htmlRemoveId } from "../../common";
|
||||
|
||||
config.global.plugins.push(Oruga);
|
||||
|
||||
let router: Router;
|
||||
|
||||
beforeEach(async () => {
|
||||
router = createRouter({
|
||||
history: createWebHistory(),
|
||||
routes: routes,
|
||||
});
|
||||
|
||||
// await router.isReady();
|
||||
});
|
||||
|
||||
const groups_mock = {
|
||||
data: {
|
||||
groups: {
|
||||
__typename: "PaginatedGroupList",
|
||||
elements: [
|
||||
{
|
||||
__typename: "Group",
|
||||
avatar: null,
|
||||
banner: null,
|
||||
domain: null,
|
||||
id: "1125368",
|
||||
name: "Group #1",
|
||||
organizedEvents: {
|
||||
__typename: "PaginatedEventList",
|
||||
elements: [],
|
||||
total: 0,
|
||||
},
|
||||
preferredUsername: "group1",
|
||||
summary: null,
|
||||
suspended: false,
|
||||
type: "GROUP",
|
||||
url: "https://mobilizon.test/@group1",
|
||||
},
|
||||
{
|
||||
__typename: "Group",
|
||||
avatar: null,
|
||||
banner: null,
|
||||
domain: null,
|
||||
id: "175368",
|
||||
name: "Group #4",
|
||||
organizedEvents: {
|
||||
__typename: "PaginatedEventList",
|
||||
elements: [],
|
||||
total: 0,
|
||||
},
|
||||
preferredUsername: "group4",
|
||||
summary: null,
|
||||
suspended: false,
|
||||
type: "GROUP",
|
||||
url: "https://mobilizon.test/@group4",
|
||||
},
|
||||
{
|
||||
__typename: "Group",
|
||||
avatar: null,
|
||||
banner: null,
|
||||
domain: null,
|
||||
id: "1126368",
|
||||
name: "Group #2",
|
||||
organizedEvents: {
|
||||
__typename: "PaginatedEventList",
|
||||
elements: [],
|
||||
total: 0,
|
||||
},
|
||||
preferredUsername: "group2",
|
||||
summary: null,
|
||||
suspended: false,
|
||||
type: "GROUP",
|
||||
url: "https://mobilizon.test/@group2",
|
||||
},
|
||||
],
|
||||
total: 3,
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
const generateWrapper = (mock_groups = {}) => {
|
||||
const global_data = getMockClient([[LIST_GROUPS, mock_groups]]);
|
||||
global_data.provide.dateFnsLocale = enUS;
|
||||
global_data.plugins = [router];
|
||||
return mount(GroupProfiles, {
|
||||
global: {
|
||||
...global_data,
|
||||
stubs: {
|
||||
RouterLink: false,
|
||||
},
|
||||
},
|
||||
});
|
||||
};
|
||||
|
||||
describe("GroupProfiles", () => {
|
||||
it("Show simple", async () => {
|
||||
const wrapper = generateWrapper(groups_mock);
|
||||
await wrapper.vm.$nextTick();
|
||||
await flushPromises();
|
||||
expect(htmlRemoveId(wrapper.html())).toMatchSnapshot();
|
||||
expect(requestHandlers.handle_0).toHaveBeenCalledTimes(1);
|
||||
expect(requestHandlers.handle_0).toHaveBeenCalledWith({
|
||||
domain: "",
|
||||
limit: 10,
|
||||
local: true,
|
||||
name: "",
|
||||
page: 1,
|
||||
preferredUsername: "",
|
||||
suspended: false,
|
||||
});
|
||||
});
|
||||
});
|
||||
@@ -1,88 +0,0 @@
|
||||
import { beforeEach, describe, it, expect } from "vitest";
|
||||
import { enUS } from "date-fns/locale";
|
||||
import { routes } from "@/router";
|
||||
import { createRouter, createWebHistory, Router } from "vue-router";
|
||||
import {
|
||||
ACCEPT_RELAY,
|
||||
ADD_INSTANCE,
|
||||
INSTANCE,
|
||||
REJECT_RELAY,
|
||||
REMOVE_RELAY,
|
||||
} from "@/graphql/admin";
|
||||
import { getMockClient, requestHandlers } from "../../mocks/client";
|
||||
import InstanceView from "@/views/Admin/InstanceView.vue";
|
||||
import { config, mount } from "@vue/test-utils";
|
||||
import { Oruga } from "@oruga-ui/oruga-next";
|
||||
import flushPromises from "flush-promises";
|
||||
|
||||
config.global.plugins.push(Oruga);
|
||||
|
||||
let router: Router;
|
||||
|
||||
beforeEach(async () => {
|
||||
router = createRouter({
|
||||
history: createWebHistory(),
|
||||
routes: routes,
|
||||
});
|
||||
|
||||
// await router.isReady();
|
||||
});
|
||||
|
||||
const instance_mock = {
|
||||
data: {
|
||||
instance: {
|
||||
__typename: "Instance",
|
||||
domain: "mobilizon.test",
|
||||
eventCount: 20,
|
||||
followedStatus: "NONE",
|
||||
followerStatus: "NONE",
|
||||
followersCount: 0,
|
||||
followingsCount: 0,
|
||||
groupCount: 1,
|
||||
hasRelay: true,
|
||||
instanceDescription: "Mobilizon for test",
|
||||
instanceName: "Mobilizon",
|
||||
mediaSize: 2951695,
|
||||
personCount: 5,
|
||||
relayAddress: "relay@mobilizon.test",
|
||||
reportsCount: 1,
|
||||
software: "Mobilizon",
|
||||
softwareVersion: "5.2.0",
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
const generateWrapper = (mock_instance = {}) => {
|
||||
const global_data = getMockClient([
|
||||
ACCEPT_RELAY,
|
||||
ADD_INSTANCE,
|
||||
[INSTANCE, mock_instance],
|
||||
REJECT_RELAY,
|
||||
REMOVE_RELAY,
|
||||
]);
|
||||
global_data.provide.dateFnsLocale = enUS;
|
||||
global_data.plugins = [router];
|
||||
return mount(InstanceView, {
|
||||
global: {
|
||||
...global_data,
|
||||
stubs: {
|
||||
RouterLink: false,
|
||||
},
|
||||
},
|
||||
});
|
||||
};
|
||||
|
||||
describe("InstanceView", () => {
|
||||
it("Show simple", async () => {
|
||||
const wrapper = generateWrapper(instance_mock);
|
||||
await wrapper.vm.$nextTick();
|
||||
await flushPromises();
|
||||
expect(wrapper.html()).toMatchSnapshot();
|
||||
expect(requestHandlers.handle_0).toHaveBeenCalledTimes(0);
|
||||
expect(requestHandlers.handle_1).toHaveBeenCalledTimes(0);
|
||||
expect(requestHandlers.handle_2).toHaveBeenCalledTimes(1);
|
||||
expect(requestHandlers.handle_3).toHaveBeenCalledTimes(0);
|
||||
expect(requestHandlers.handle_4).toHaveBeenCalledTimes(0);
|
||||
expect(requestHandlers.handle_2).toHaveBeenCalledWith({});
|
||||
});
|
||||
});
|
||||
@@ -1,106 +0,0 @@
|
||||
import { beforeEach, describe, it, expect } from "vitest";
|
||||
import { enUS } from "date-fns/locale";
|
||||
import { routes } from "@/router";
|
||||
import { createRouter, createWebHistory, Router } from "vue-router";
|
||||
import { getMockClient, requestHandlers } from "../../mocks/client";
|
||||
import InstancesView from "@/views/Admin/InstancesView.vue";
|
||||
import { config, mount } from "@vue/test-utils";
|
||||
import { Oruga } from "@oruga-ui/oruga-next";
|
||||
import flushPromises from "flush-promises";
|
||||
import { ADD_INSTANCE, INSTANCES } from "@/graphql/admin";
|
||||
|
||||
config.global.plugins.push(Oruga);
|
||||
|
||||
let router: Router;
|
||||
|
||||
beforeEach(async () => {
|
||||
router = createRouter({
|
||||
history: createWebHistory(),
|
||||
routes: routes,
|
||||
});
|
||||
|
||||
// await router.isReady();
|
||||
});
|
||||
|
||||
const instances_mock = {
|
||||
data: {
|
||||
instances: {
|
||||
__typename: "PaginatedInstanceList",
|
||||
elements: [
|
||||
{
|
||||
__typename: "Instance",
|
||||
domain: "mobilizon.test",
|
||||
eventCount: 20,
|
||||
followedStatus: "NONE",
|
||||
followerStatus: "NONE",
|
||||
followersCount: 0,
|
||||
followingsCount: 0,
|
||||
groupCount: 1,
|
||||
hasRelay: true,
|
||||
instanceDescription: "Mobilizon for test.",
|
||||
instanceName: "Mobilizon",
|
||||
mediaSize: 2951695,
|
||||
personCount: 5,
|
||||
relayAddress: "relay@mobilizon.test",
|
||||
reportsCount: 1,
|
||||
software: "Mobilizon",
|
||||
softwareVersion: "5.2.0",
|
||||
},
|
||||
{
|
||||
__typename: "Instance",
|
||||
domain: "agenda.test",
|
||||
eventCount: 4,
|
||||
followedStatus: "APPROVED",
|
||||
followerStatus: "NONE",
|
||||
followersCount: 0,
|
||||
followingsCount: 12,
|
||||
groupCount: 0,
|
||||
hasRelay: true,
|
||||
instanceDescription: "agenda gancio",
|
||||
instanceName: "Agenda de Crémeaux",
|
||||
mediaSize: 3774456,
|
||||
personCount: 0,
|
||||
relayAddress: "events@agenda.test",
|
||||
reportsCount: 0,
|
||||
software: "gancio",
|
||||
softwareVersion: "1.27.0",
|
||||
},
|
||||
],
|
||||
total: 2,
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
const generateWrapper = (mock_instances = {}) => {
|
||||
const global_data = getMockClient([
|
||||
ADD_INSTANCE,
|
||||
[INSTANCES, mock_instances],
|
||||
]);
|
||||
global_data.provide.dateFnsLocale = enUS;
|
||||
global_data.plugins = [router];
|
||||
return mount(InstancesView, {
|
||||
global: {
|
||||
...global_data,
|
||||
stubs: {
|
||||
RouterLink: false,
|
||||
},
|
||||
},
|
||||
});
|
||||
};
|
||||
|
||||
describe("InstancesView", () => {
|
||||
it("Show simple", async () => {
|
||||
const wrapper = generateWrapper(instances_mock);
|
||||
await wrapper.vm.$nextTick();
|
||||
await flushPromises();
|
||||
expect(wrapper.html()).toMatchSnapshot();
|
||||
expect(requestHandlers.handle_0).toHaveBeenCalledTimes(0);
|
||||
expect(requestHandlers.handle_1).toHaveBeenCalledTimes(1);
|
||||
expect(requestHandlers.handle_1).toHaveBeenCalledWith({
|
||||
filterDomain: "",
|
||||
filterFollowStatus: "ALL",
|
||||
limit: 10,
|
||||
page: 1,
|
||||
});
|
||||
});
|
||||
});
|
||||
@@ -1,101 +0,0 @@
|
||||
import { beforeEach, describe, it, expect } from "vitest";
|
||||
import { enUS } from "date-fns/locale";
|
||||
import { routes } from "@/router";
|
||||
import { createRouter, createWebHistory, Router } from "vue-router";
|
||||
import { getMockClient, requestHandlers } from "../../mocks/client";
|
||||
import ProfilesView from "@/views/Admin/ProfilesView.vue";
|
||||
import { config, mount } from "@vue/test-utils";
|
||||
import { Oruga } from "@oruga-ui/oruga-next";
|
||||
import flushPromises from "flush-promises";
|
||||
import { LIST_PROFILES } from "@/graphql/actor";
|
||||
import { htmlRemoveId } from "../../common";
|
||||
|
||||
config.global.plugins.push(Oruga);
|
||||
|
||||
let router: Router;
|
||||
|
||||
beforeEach(async () => {
|
||||
router = createRouter({
|
||||
history: createWebHistory(),
|
||||
routes: routes,
|
||||
});
|
||||
|
||||
// await router.isReady();
|
||||
});
|
||||
|
||||
const profiles_mock = {
|
||||
data: {
|
||||
persons: {
|
||||
__typename: "PaginatedPersonList",
|
||||
elements: [
|
||||
{
|
||||
__typename: "Person",
|
||||
avatar: null,
|
||||
domain: null,
|
||||
id: "1",
|
||||
name: "Mobilizon Anonymous Actor",
|
||||
preferredUsername: "anonymous",
|
||||
summary: "A fake person for anonymous participations",
|
||||
type: "PERSON",
|
||||
url: "https://mobilizion.test/@anonymous",
|
||||
},
|
||||
{
|
||||
__typename: "Person",
|
||||
avatar: null,
|
||||
domain: null,
|
||||
id: "2",
|
||||
name: "Mobilizon",
|
||||
preferredUsername: "mobilizon",
|
||||
summary: null,
|
||||
type: "PERSON",
|
||||
url: "https://mobilizion.test/@mobilizon",
|
||||
},
|
||||
{
|
||||
__typename: "Person",
|
||||
avatar: null,
|
||||
domain: null,
|
||||
id: "109687",
|
||||
name: "Example",
|
||||
preferredUsername: "example",
|
||||
summary: "Profile for example",
|
||||
type: "PERSON",
|
||||
url: "https://mobilizion.test/@example",
|
||||
},
|
||||
],
|
||||
total: 3,
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
const generateWrapper = (mock_profiles = {}) => {
|
||||
const global_data = getMockClient([[LIST_PROFILES, mock_profiles]]);
|
||||
global_data.provide.dateFnsLocale = enUS;
|
||||
global_data.plugins = [router];
|
||||
return mount(ProfilesView, {
|
||||
global: {
|
||||
...global_data,
|
||||
stubs: {
|
||||
RouterLink: false,
|
||||
},
|
||||
},
|
||||
});
|
||||
};
|
||||
|
||||
describe("ProfilesView", () => {
|
||||
it("Show simple", async () => {
|
||||
const wrapper = generateWrapper(profiles_mock);
|
||||
await wrapper.vm.$nextTick();
|
||||
await flushPromises();
|
||||
expect(htmlRemoveId(wrapper.html())).toMatchSnapshot();
|
||||
expect(requestHandlers.handle_0).toHaveBeenCalledTimes(1);
|
||||
expect(requestHandlers.handle_0).toHaveBeenCalledWith({
|
||||
domain: "",
|
||||
limit: 10,
|
||||
local: true,
|
||||
name: "",
|
||||
page: 1,
|
||||
preferredUsername: "",
|
||||
suspended: false,
|
||||
});
|
||||
});
|
||||
});
|
||||
@@ -1,176 +0,0 @@
|
||||
import { describe, it, expect, vi } from "vitest";
|
||||
import { DefaultApolloClient } from "@vue/apollo-composable";
|
||||
import { shallowMount } from "@vue/test-utils";
|
||||
import buildCurrentUserResolver from "@/apollo/user";
|
||||
import flushPromises from "flush-promises";
|
||||
import { cache } from "@/apollo/memory";
|
||||
import {
|
||||
createMockClient,
|
||||
MockApolloClient,
|
||||
RequestHandler,
|
||||
} from "mock-apollo-client";
|
||||
import SettingsView from "@/views/Admin/SettingsView.vue";
|
||||
import { nullMock } from "../../common";
|
||||
import { CONFIG } from "@/graphql/config";
|
||||
import {
|
||||
ADMIN_SETTINGS,
|
||||
SAVE_ADMIN_SETTINGS,
|
||||
LANGUAGES,
|
||||
} from "@/graphql/admin";
|
||||
|
||||
let mockClient: MockApolloClient | null;
|
||||
let requestHandlers: Record<string, RequestHandler>;
|
||||
|
||||
const languageMock = {
|
||||
data: {
|
||||
languages: [
|
||||
{
|
||||
__typename: "Language",
|
||||
code: "es",
|
||||
name: "Spanish",
|
||||
},
|
||||
{
|
||||
__typename: "Language",
|
||||
code: "fr-FR",
|
||||
name: "Français",
|
||||
},
|
||||
{
|
||||
__typename: "Language",
|
||||
code: "en-EN",
|
||||
name: "English",
|
||||
},
|
||||
],
|
||||
},
|
||||
};
|
||||
|
||||
const settingMock = {
|
||||
data: {
|
||||
adminSettings: {
|
||||
__typename: "AdminSettings",
|
||||
contact: "info@mobilizon.test",
|
||||
defaultPicture: null,
|
||||
instanceDescription: "Welcome to Mobilizon",
|
||||
instanceFavicon: null,
|
||||
instanceLanguages: ["fr"],
|
||||
instanceLogo: null,
|
||||
instanceLongDescription: "Mobilizon instance.",
|
||||
instanceName: "Mobilizon.test",
|
||||
instancePrivacyPolicy: '<p class="message-body">Privacy policy</p>',
|
||||
instancePrivacyPolicyType: "DEFAULT",
|
||||
instancePrivacyPolicyUrl: null,
|
||||
instanceRules: null,
|
||||
instanceSlogan: "Long life to Mobilizon",
|
||||
instanceTerms: '<p class="message-body">Rulls and terms</p>',
|
||||
instanceTermsType: "DEFAULT",
|
||||
instanceTermsUrl: null,
|
||||
primaryColor: null,
|
||||
registrationsOpen: true,
|
||||
registrationsModeration: false,
|
||||
secondaryColor: null,
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
const generateWrapper = () => {
|
||||
mockClient = createMockClient({
|
||||
cache,
|
||||
resolvers: buildCurrentUserResolver(cache),
|
||||
});
|
||||
requestHandlers = {
|
||||
config: vi.fn().mockResolvedValue(nullMock),
|
||||
settings: vi.fn().mockResolvedValue(settingMock),
|
||||
save_settings: vi.fn().mockResolvedValue(nullMock),
|
||||
languages: vi.fn().mockResolvedValue(languageMock),
|
||||
};
|
||||
mockClient.setRequestHandler(CONFIG, requestHandlers.config);
|
||||
mockClient.setRequestHandler(ADMIN_SETTINGS, requestHandlers.settings);
|
||||
mockClient.setRequestHandler(
|
||||
SAVE_ADMIN_SETTINGS,
|
||||
requestHandlers.save_settings
|
||||
);
|
||||
mockClient.setRequestHandler(LANGUAGES, requestHandlers.languages);
|
||||
|
||||
return shallowMount(SettingsView, {
|
||||
props: {},
|
||||
global: {
|
||||
provide: {
|
||||
[DefaultApolloClient]: mockClient,
|
||||
},
|
||||
},
|
||||
});
|
||||
};
|
||||
|
||||
describe("SettingsView", () => {
|
||||
it("Show and save settings", async () => {
|
||||
const wrapper = generateWrapper();
|
||||
await wrapper.vm.$nextTick();
|
||||
await flushPromises();
|
||||
expect(wrapper.exists()).toBe(true);
|
||||
expect(requestHandlers.config).toHaveBeenCalled();
|
||||
expect(requestHandlers.languages).toHaveBeenCalled();
|
||||
expect(requestHandlers.settings).toHaveBeenCalled();
|
||||
expect(requestHandlers.save_settings).toHaveBeenCalledTimes(0);
|
||||
expect(wrapper.html()).toMatchSnapshot();
|
||||
|
||||
expect(wrapper.find("#instance-description").attributes("modelvalue")).toBe(
|
||||
"Welcome to Mobilizon"
|
||||
);
|
||||
expect(wrapper.find("#instance-contact").attributes("modelvalue")).toBe(
|
||||
"info@mobilizon.test"
|
||||
);
|
||||
const radiolist1 = wrapper
|
||||
.findAll('o-radio[name="registrationsModeType"]')
|
||||
.filter(
|
||||
(radio) =>
|
||||
radio.attributes("modelvalue") == radio.attributes("native-value")
|
||||
);
|
||||
expect(radiolist1.length).toBe(1);
|
||||
expect(radiolist1[0].text()).toBe(
|
||||
"Registration is allowed, anyone can register."
|
||||
);
|
||||
|
||||
wrapper.vm.settingsToWrite.instanceDescription = "Best Mobilizon";
|
||||
wrapper.vm.settingsToWrite.contact = "some@email.tld";
|
||||
wrapper.vm.settingsToWrite.registrationsOpen = false;
|
||||
await wrapper.vm.$nextTick();
|
||||
expect(wrapper.find("#instance-description").attributes("modelvalue")).toBe(
|
||||
"Best Mobilizon"
|
||||
);
|
||||
expect(wrapper.find("#instance-contact").attributes("modelvalue")).toBe(
|
||||
"some@email.tld"
|
||||
);
|
||||
const radiolist2 = wrapper
|
||||
.findAll('o-radio[name="registrationsModeType"]')
|
||||
.filter(
|
||||
(radio) =>
|
||||
radio.attributes("modelvalue") == radio.attributes("native-value")
|
||||
);
|
||||
expect(radiolist2.length).toBe(1);
|
||||
expect(radiolist2[0].text()).toBe("Registration is closed.");
|
||||
wrapper.find("form").trigger("submit");
|
||||
expect(requestHandlers.save_settings).toHaveBeenCalledTimes(1);
|
||||
expect(requestHandlers.save_settings).toBeCalledWith({
|
||||
...settingMock.data.adminSettings,
|
||||
contact: "some@email.tld",
|
||||
instanceDescription: "Best Mobilizon",
|
||||
registrationsOpen: false,
|
||||
defaultPicture: {},
|
||||
instanceFavicon: {},
|
||||
instanceLogo: {},
|
||||
});
|
||||
|
||||
wrapper.vm.settingsToWrite.registrationsOpen = true;
|
||||
wrapper.vm.settingsToWrite.registrationsModeration = true;
|
||||
await wrapper.vm.$nextTick();
|
||||
const radiolist3 = wrapper
|
||||
.findAll('o-radio[name="registrationsModeType"]')
|
||||
.filter(
|
||||
(radio) =>
|
||||
radio.attributes("modelvalue") == radio.attributes("native-value")
|
||||
);
|
||||
expect(radiolist3.length).toBe(1);
|
||||
expect(radiolist3[0].text()).toBe(
|
||||
"Registration is moderated, new user must be validated."
|
||||
);
|
||||
});
|
||||
});
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user