perform front-end unit test from "view/Admin" - #1805
This commit is contained in:
@@ -0,0 +1,255 @@
|
||||
// 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" 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</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>Local</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-->
|
||||
<!--v-if-->
|
||||
</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>"
|
||||
`;
|
||||
@@ -0,0 +1,258 @@
|
||||
// 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 suspend 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>"
|
||||
`;
|
||||
@@ -0,0 +1,28 @@
|
||||
// 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>"
|
||||
`;
|
||||
@@ -0,0 +1,122 @@
|
||||
// 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>"
|
||||
`;
|
||||
@@ -0,0 +1,33 @@
|
||||
// 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.1.5</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>"
|
||||
`;
|
||||
@@ -0,0 +1,119 @@
|
||||
// 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>"
|
||||
`;
|
||||
@@ -0,0 +1,115 @@
|
||||
// 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>"
|
||||
`;
|
||||
134
tests/unit/specs/components/admin/adminGroupProfile.spec.ts
Normal file
134
tests/unit/specs/components/admin/adminGroupProfile.spec.ts
Normal file
@@ -0,0 +1,134 @@
|
||||
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";
|
||||
|
||||
config.global.plugins.push(Oruga);
|
||||
|
||||
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: null,
|
||||
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,
|
||||
});
|
||||
});
|
||||
});
|
||||
114
tests/unit/specs/components/admin/adminProfile.spec.ts
Normal file
114
tests/unit/specs/components/admin/adminProfile.spec.ts
Normal file
@@ -0,0 +1,114 @@
|
||||
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,
|
||||
});
|
||||
});
|
||||
});
|
||||
129
tests/unit/specs/components/admin/dashboard.spec.ts
Normal file
129
tests/unit/specs/components/admin/dashboard.spec.ts
Normal file
@@ -0,0 +1,129 @@
|
||||
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({});
|
||||
});
|
||||
});
|
||||
122
tests/unit/specs/components/admin/groupProfiles.spec.ts
Normal file
122
tests/unit/specs/components/admin/groupProfiles.spec.ts
Normal file
@@ -0,0 +1,122 @@
|
||||
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,
|
||||
});
|
||||
});
|
||||
});
|
||||
88
tests/unit/specs/components/admin/instanceView.spec.ts
Normal file
88
tests/unit/specs/components/admin/instanceView.spec.ts
Normal file
@@ -0,0 +1,88 @@
|
||||
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.1.5",
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
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({});
|
||||
});
|
||||
});
|
||||
106
tests/unit/specs/components/admin/instancesView.spec.ts
Normal file
106
tests/unit/specs/components/admin/instancesView.spec.ts
Normal file
@@ -0,0 +1,106 @@
|
||||
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.1.5",
|
||||
},
|
||||
{
|
||||
__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,
|
||||
});
|
||||
});
|
||||
});
|
||||
101
tests/unit/specs/components/admin/profilesView.spec.ts
Normal file
101
tests/unit/specs/components/admin/profilesView.spec.ts
Normal file
@@ -0,0 +1,101 @@
|
||||
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,
|
||||
});
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user