diff --git a/__mocks__/axios.js b/__mocks__/axios.js
new file mode 100644
index 000000000..73f85aab7
--- /dev/null
+++ b/__mocks__/axios.js
@@ -0,0 +1,10 @@
+const { jest } = require('@jest/globals');
+module.exports = {
+ create: jest.fn(() => ({
+ defaults: { headers: { common: {} } },
+ interceptors: {
+ request: { use: jest.fn() },
+ response: { use: jest.fn() },
+ },
+ })),
+};
diff --git a/__mocks__/fileMock.js b/__mocks__/fileMock.js
new file mode 100644
index 000000000..86059f362
--- /dev/null
+++ b/__mocks__/fileMock.js
@@ -0,0 +1 @@
+module.exports = 'test-file-stub';
diff --git a/babel.config.cjs b/babel.config.cjs
new file mode 100644
index 000000000..a79d11957
--- /dev/null
+++ b/babel.config.cjs
@@ -0,0 +1,3 @@
+module.exports = {
+ presets: ['@babel/preset-env'],
+};
diff --git a/docs/.vitepress/config.mjs b/docs/.vitepress/config.mjs
index 1ae0961fd..3c4541978 100644
--- a/docs/.vitepress/config.mjs
+++ b/docs/.vitepress/config.mjs
@@ -546,6 +546,16 @@ export default withMermaid({
}
]
},
+ {
+ "text": "tests",
+ "collapsed": true,
+ "items": [
+ {
+ "text": "Carousel.test",
+ "link": "/src/tests\\Carousel.test"
+ }
+ ]
+ },
{
"text": "utils",
"collapsed": true,
diff --git a/docs/.vitepress/theme/index.js b/docs/.vitepress/theme/index.js
new file mode 100644
index 000000000..66163ce60
--- /dev/null
+++ b/docs/.vitepress/theme/index.js
@@ -0,0 +1,19 @@
+import DefaultTheme from 'vitepress/theme';
+import { withMermaid } from 'vitepress-plugin-mermaid';
+import TestRunner from './components/TestRunner.vue';
+
+export default withMermaid({
+ ...DefaultTheme,
+ themeConfig: {
+ search: {
+ provider: 'local',
+ },
+ },
+ mermaid: {},
+ mermaidPlugin: {
+ class: 'mermaid my-class',
+ },
+ enhanceApp({ app }) {
+ app.component('TestRunner', TestRunner);
+ },
+});
diff --git a/docs/index.md b/docs/index.md
index 4ebe03a6c..8af0a13b0 100644
--- a/docs/index.md
+++ b/docs/index.md
@@ -20,5 +20,8 @@ features:
- title: Правила коммитов
details: Подробная инструкция по наименованию коммитов
link: /guides/commits
+ - title: Тестирование проекта
+ details: Запуск автотестов
+ link: /tests
---
diff --git a/docs/src/components/cardLike.md b/docs/src/components/cardLike.md
index a6f305b98..8c1edcfe9 100644
--- a/docs/src/components/cardLike.md
+++ b/docs/src/components/cardLike.md
@@ -1,108 +1,10 @@
# cardLike
-### Обратная связь: Компонент для отображения формы обратной связи с оценкой и комментарием
-
## Описание пропсов
| Пропс | Тип | Значение по умолчанию | Комментарий |
|-------|-----|-----------------------|-------------|
-| `LikeDialog` | `Boolean` | `false` | Состояние модального окна |
-## Описание переменных
-
-| Переменная | Значение | Описание |
-|------------|----------|----------|
-| `feedalert` |
useAlertStore().alert
| Получает объект alert из хранилища
alert для уведомлений
|
-| `feedbackdata` | ref({ nowcomment: { comment:
'' }, nowrating: [] })
| Хранит данные обратной связи,
включая комментарии и оценки
|
-
-## Описание функций:
-
-
-🛠️ f_feedbackdata - Выполняет загрузку данных обратной связи с сервера.
-
-```js
-function f_feedbackdata() {
- axiosApiInstance.get('api/feedback/feedbackdata/')
- .then(data => {
- feedbackdata.value = data.data;
- // Если оценки отсутствуют, инициализируем их
- if (feedbackdata.value.nowrating.length === 0) {
- for (let x of feedbackdata.value.basecrit) {
- feedbackdata.value.nowrating.push({ rating: x.rating, crit: x.id, id: null });
- }
- }
- // Если комментарий отсутствует, создаем пустой объект
- if (feedbackdata.value.nowcomment === null) {
- feedbackdata.value.nowcomment = { comment: '', id: null };
- }
- });
- }
-```
-
-
-
-🛠️ menusCloses - Управляет закрытием диалога меню.
-
-```js
-function menusCloses() {
- emit('menusClose');
- }
-```
-
-
-
-🛠️ feedSend - Выполняет отправку данных обратной связи на сервер.
-
-```js
-function feedSend() {
- axiosApiInstance.post(`api/feedback/feedbackdata/`, {
- nowrating: feedbackdata.value.nowrating,
- nowcomment: feedbackdata.value.nowcomment,
- }).then(data => {
- // Действия после успешной отправки можно добавить здесь.
- });
- feedalert.alert = true;
- textFromAlert();
- menusCloses();
- }
-```
-
-
-## Описание стрелочных функций:
-
-
-🛠️ textFromAlert - Обрабатывает текст уведомления в зависимости от наличия id комментария.
-
-```js
-const textFromAlert = () => {
- if (feedbackdata.value.nowcomment.id == null) {
- feedalert.text = 'Оценка отправлена, спасибо за участие';
- feedalert.ico = 'mdi-redo-variant';
- feedalert.color = 'green-darken-4';
- } else {
- feedalert.text = 'Оценка обновлена';
- feedalert.ico = 'mdi-refresh';
- feedalert.color = 'light-blue-darken-4';
- }
- }
-```
-
-
-## Описание computed:
-
-
-🚀 average - Подсчитывает средний рейтинг на основе оценок пользователя.
-
-```js
-const average = computed(() => {
- const sum = feedbackdata.value.nowrating.reduce((total, obj) => total + obj.rating, 0);
- const sumlen = sum / feedbackdata.value.nowrating.length;
- const ukr = Number.isInteger(sumlen) ? sumlen : sumlen.toFixed(1);
- return ukr;
- }
-);
-```
-
-
+| `LikeDialog` | `Boolean` | `false` | нет комментария |
## Пример использования
diff --git a/docs/src/components/dialog-search.md b/docs/src/components/dialog-search.md
index d791d14f6..75e03f13d 100644
--- a/docs/src/components/dialog-search.md
+++ b/docs/src/components/dialog-search.md
@@ -1,71 +1,13 @@
# dialog-search
-### Компонент списка пользователей: Отображает список участников по позиции с возможностью поиска
+###
## Описание пропсов
| Пропс | Тип | Значение по умолчанию | Комментарий |
|-------|-----|-----------------------|-------------|
-| `idpos` | `Number` | `""` | ID позиции для загрузки списка |
-| `namepos` | `String` | `""` | Название позиции для отображения в заголовке |
-## Описание переменных
-
-| Переменная | Значение | Описание |
-|------------|----------|----------|
-| `t_dailyRound` | ref({})
| Хранит данные дневного отчета по
пользователям
|
-| `iduser` | ref("")
| Хранит выбранный ID пользователя
|
-| `searchname` | ref("")
| Хранит строку поиска для фильтрации
пользователей
|
-
-## Описание стрелочных функций:
-
-
-🛠️ onSubmit - Хранит данные дневного отчета по пользователям.
-
-```js
-const onSubmit = () => {
- emit("searchClose");
- }
-```
-
-
-
-🛠️ getcard - Преобразует выбранного пользователя по ID.
-
-**Аргументы:**
-
-| Имя аргумента | Тип | Описание |
-|--------------|-----|----------|
-| `idus` | `number` | ID пользователя. |
-
-```js
-async const getcard = (idus) => {
- iduser.value = idus;
- }
-```
-
-
-## Описание computed:
-
-
-🚀 result - Определяет отфильтрованные данные дневного отчета по введенному имени.
-
-```js
-const result = computed(() => {
- const ob = {};
- Object.keys(t_dailyRound.value).forEach((el1) => {
- const myarr = t_dailyRound.value[el1].filter((el) =>
- el.fio.toLowerCase().includes(searchname.value.toLowerCase())
- );
- if (myarr.length > 0) {
- ob[el1] = myarr;
- }
- });
- return ob;
- }
-);
-```
-
-
+| `idpos` | `Number` | `""` | нет комментария |
+| `namepos` | `String` | `""` | нет комментария |
## Пример использования
diff --git a/docs/src/tests/Carousel.spec.md b/docs/src/tests/Carousel.spec.md
new file mode 100644
index 000000000..eadc83855
--- /dev/null
+++ b/docs/src/tests/Carousel.spec.md
@@ -0,0 +1,10 @@
+# Carousel.spec
+
+Описание отсутствует.
+
+```js
+import * as Carousel.spec from '@/components/tests\Carousel.spec';
+```
+
+---
+> Документация сгенерирована автоматически.
diff --git a/docs/src/tests/Carousel.test.md b/docs/src/tests/Carousel.test.md
new file mode 100644
index 000000000..0ced10a94
--- /dev/null
+++ b/docs/src/tests/Carousel.test.md
@@ -0,0 +1,10 @@
+# Carousel.test
+
+Описание отсутствует.
+
+```js
+import * as Carousel.test from '@/components/tests\Carousel.test';
+```
+
+---
+> Документация сгенерирована автоматически.
diff --git a/docs/test-coverage/assets/FNS-logo-xs.png.html b/docs/test-coverage/assets/FNS-logo-xs.png.html
new file mode 100644
index 000000000..03a4ace4b
--- /dev/null
+++ b/docs/test-coverage/assets/FNS-logo-xs.png.html
@@ -0,0 +1,376 @@
+
+
+
+
+
+ Code coverage report for assets/FNS-logo-xs.png
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 100%
+ Statements
+ 1/1
+
+
+
+
+ 100%
+ Branches
+ 0/0
+
+
+
+
+ 100%
+ Functions
+ 0/0
+
+
+
+
+ 100%
+ Lines
+ 1/1
+
+
+
+
+
+ Press n or j to go to the next uncovered block, b, p or k for the previous block.
+
+
+
+ Filter:
+
+
+
+
+
+