forked from eatvio/eatvio-infra
Merge pull request 'main' (#1) from eatvio/eatvio:main into main
Reviewed-on: https://gittea.eatv.io/alex_chevski/eatvio/pulls/1
This commit is contained in:
@@ -1,19 +0,0 @@
|
||||
name: Gitea Actions Demo
|
||||
run-name: ${{ gitea.actor }} is testing out Gitea Actions
|
||||
on: [push]
|
||||
|
||||
jobs:
|
||||
Explore-Gitea-Actions:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- run: echo "🎉 The job was automatically triggered by a ${{ gitea.event_name }} event."
|
||||
- run: echo "🐧 This job is now running on a ${{ runner.os }} server hosted by Gitea!"
|
||||
- run: echo "🔎 The name of your branch is ${{ gitea.ref }} and your repository is ${{ gitea.repository }}."
|
||||
- name: Check out repository code
|
||||
uses: actions/checkout@v3
|
||||
- run: echo "💡 The ${{ gitea.repository }} repository has been cloned to the runner."
|
||||
- run: echo "The workflow is now ready to test your code on the runner."
|
||||
- name: List files in the repository
|
||||
run: |
|
||||
ls ${{ gitea.workspace }}
|
||||
- run: echo "🍏 This job's status is ${{ job.status }}."
|
||||
@@ -1,13 +1,66 @@
|
||||
name: 'Test new actor runner 1.0'
|
||||
name: 'Test new actor runner 1.1'
|
||||
on: [push]
|
||||
|
||||
jobs:
|
||||
test:
|
||||
runs-on: ubuntu-latest
|
||||
name: Test
|
||||
env:
|
||||
extensions: gd, sqlite3
|
||||
php-version: '8.2'
|
||||
key: cache-v1 # can be any string, change to clear the extension cache.
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: apoloz/laravel-test-runner@v1.1.13
|
||||
|
||||
- name: Setup cache environment
|
||||
id: extcache
|
||||
uses: apoloz/cache-extensions@v1
|
||||
with:
|
||||
php-version: 8.2
|
||||
setup: 'true'
|
||||
php-version: ${{ php-version }}
|
||||
extensions: ${{ env.extensions }}
|
||||
key: ${{ env.key }}
|
||||
|
||||
- name: Cache extensions
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: ${{ steps.extcache.outputs.dir }}
|
||||
key: ${{ steps.extcache.outputs.key }}
|
||||
restore-keys: ${{ steps.extcache.outputs.key }}
|
||||
|
||||
- name: Setup PHP
|
||||
uses: apoloz/setup-php@v2
|
||||
with:
|
||||
php-version: ${{ php-version }}
|
||||
extensions: ${{ env.extensions }}
|
||||
coverage: none
|
||||
|
||||
- name: Get composer cache directory
|
||||
id: composer-cache
|
||||
run: |
|
||||
echo "dir=$(composer config cache-files-dir)"
|
||||
echo "ls -la"
|
||||
echo "composerhash=$(md5sum composer.lock|awk '{print $1}')" >> $GITHUB_OUTPUT
|
||||
echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Cache composer dependencies
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: ${{ steps.composer-cache.outputs.dir }}
|
||||
# Use composer.json for key, if composer.lock is not committed.
|
||||
# key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
|
||||
key: ${{ runner.os }}-composer-${{ steps.composer-cache.outputs.composerhash }}
|
||||
restore-keys: ${{ runner.os }}-composer-
|
||||
|
||||
- name: Install composer dependencies
|
||||
env:
|
||||
COMPOSER_AUTH: '{"github-oauth": {"github.com": "${{ vars.GH_KEY }}"} }'
|
||||
run: composer install
|
||||
|
||||
- name: Run test
|
||||
run: vendor/bin/phpunit
|
||||
|
||||
# - name: Run Pint
|
||||
# run: vendor/bin/pint
|
||||
#
|
||||
# - name: Run Static Analysis
|
||||
# run: composer static-analysis
|
||||
|
||||
@@ -16,6 +16,7 @@ class DatabaseSeeder extends Seeder
|
||||
{
|
||||
$this->call(PlanSeeder::class);
|
||||
$this->call(UserSeeder::class);
|
||||
// $this->call(RecipeSeeder::class);
|
||||
// \App\Models\User::factory(10)->create();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,7 @@
|
||||
<x-guest-layout>
|
||||
@push('css_head')
|
||||
<script src="https://cdn.tailwindcss.com"></script>
|
||||
@endpush
|
||||
<x-authentication-card>
|
||||
<x-slot name="logo">
|
||||
<x-authentication-card-logo />
|
||||
|
||||
@@ -1,4 +1,7 @@
|
||||
<x-guest-layout>
|
||||
@push('css_head')
|
||||
<script src="https://cdn.tailwindcss.com"></script>
|
||||
@endpush
|
||||
<x-authentication-card>
|
||||
<x-slot name="logo">
|
||||
<x-authentication-card-logo />
|
||||
|
||||
@@ -1,4 +1,8 @@
|
||||
<x-guest-layout>
|
||||
|
||||
@push('css_head')
|
||||
<script src="https://cdn.tailwindcss.com"></script>
|
||||
@endpush
|
||||
<x-authentication-card>
|
||||
<x-slot name="logo">
|
||||
<x-authentication-card-logo />
|
||||
|
||||
@@ -1,4 +1,7 @@
|
||||
<x-guest-layout>
|
||||
@push('css_head')
|
||||
<script src="https://cdn.tailwindcss.com"></script>
|
||||
@endpush
|
||||
<x-authentication-card>
|
||||
<x-slot name="logo">
|
||||
<x-authentication-card-logo />
|
||||
|
||||
@@ -1,4 +1,7 @@
|
||||
<x-guest-layout>
|
||||
@push('css_head')
|
||||
<script src="https://cdn.tailwindcss.com"></script>
|
||||
@endpush
|
||||
<x-authentication-card>
|
||||
<x-slot name="logo">
|
||||
<x-authentication-card-logo />
|
||||
|
||||
@@ -1,4 +1,7 @@
|
||||
<x-guest-layout>
|
||||
@push('css_head')
|
||||
<script src="https://cdn.tailwindcss.com"></script>
|
||||
@endpush
|
||||
<x-authentication-card>
|
||||
<x-slot name="logo">
|
||||
<x-authentication-card-logo />
|
||||
|
||||
@@ -1,4 +1,7 @@
|
||||
<x-guest-layout>
|
||||
@push('css_head')
|
||||
<script src="https://cdn.tailwindcss.com"></script>
|
||||
@endpush
|
||||
<x-authentication-card>
|
||||
<x-slot name="logo">
|
||||
<x-authentication-card-logo />
|
||||
|
||||
@@ -8,3 +8,9 @@
|
||||
<script src="/js/bootstrap.min.js"></script>
|
||||
<script src="/js/bootstrap.bundle.min.js"></script>
|
||||
@endpush
|
||||
@push('css_head')
|
||||
<script src="https://cdn.tailwindcss.com"></script>
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" integrity="sha384-T3c6CoIi6uLrA9TneNEoa7RxnatzjcDSCmG1MXxSR1GAsXEV/Dwwykc2MPK8M2HN" crossorigin="anonymous">
|
||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.min.js" integrity="sha384-BBtl+eGJRgqQAUMxJ7pMwbEyER4l1g+O15P+16Ep7Q9Q+zqX6gSbd85u4mG4QzX+" crossorigin="anonymous"></script>
|
||||
@endpush
|
||||
|
||||
|
||||
@@ -1,5 +1,11 @@
|
||||
@extends('layouts/eatvio')
|
||||
@section('page_title', 'Chat')
|
||||
@push('css_head')
|
||||
<script src="https://cdn.tailwindcss.com"></script>
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" integrity="sha384-T3c6CoIi6uLrA9TneNEoa7RxnatzjcDSCmG1MXxSR1GAsXEV/Dwwykc2MPK8M2HN" crossorigin="anonymous">
|
||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.min.js" integrity="sha384-BBtl+eGJRgqQAUMxJ7pMwbEyER4l1g+O15P+16Ep7Q9Q+zqX6gSbd85u4mG4QzX+" crossorigin="anonymous"></script>
|
||||
@endpush
|
||||
|
||||
@section('main_section')
|
||||
<section class="py-md-3 px-0 px-md-2 px-lg-3 --h_90vh" id="main" x-data>
|
||||
<div class="container position-relative px-0 py-md-2 --mw-1170 --h_100">
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
@extends('layouts/eatvio')
|
||||
|
||||
|
||||
@section('main_section')
|
||||
<section class="py-5" id="main">
|
||||
<div class="container d-flex justify-content-between align-items-center mb-4 px-4 py-2 --bg_white --shadow --radius --mw-1000">
|
||||
|
||||
@@ -1,4 +1,9 @@
|
||||
@extends('layouts/eatvio')
|
||||
@push('css_head')
|
||||
<script src="https://cdn.tailwindcss.com"></script>
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" integrity="sha384-T3c6CoIi6uLrA9TneNEoa7RxnatzjcDSCmG1MXxSR1GAsXEV/Dwwykc2MPK8M2HN" crossorigin="anonymous">
|
||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.min.js" integrity="sha384-BBtl+eGJRgqQAUMxJ7pMwbEyER4l1g+O15P+16Ep7Q9Q+zqX6gSbd85u4mG4QzX+" crossorigin="anonymous"></script>
|
||||
@endpush
|
||||
@section('main_section')
|
||||
<section class="py-5" id="main">
|
||||
<div class="container d-flex justify-content-between align-items-center mb-4 px-4 py-2 --bg_white --shadow --radius --mw-1000">
|
||||
|
||||
@@ -9,6 +9,12 @@
|
||||
|
||||
$mealNames = ['breakfast', 'dinner', 'supper', 'lunch', 'snacks'];
|
||||
@endphp
|
||||
@push('css_head')
|
||||
<script src="https://cdn.tailwindcss.com"></script>
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" integrity="sha384-T3c6CoIi6uLrA9TneNEoa7RxnatzjcDSCmG1MXxSR1GAsXEV/Dwwykc2MPK8M2HN" crossorigin="anonymous">
|
||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.min.js" integrity="sha384-BBtl+eGJRgqQAUMxJ7pMwbEyER4l1g+O15P+16Ep7Q9Q+zqX6gSbd85u4mG4QzX+" crossorigin="anonymous"></script>
|
||||
@endpush
|
||||
|
||||
@section('main_section')
|
||||
<section class="py-5" id="main">
|
||||
<form class="container d-block d-sm-flex justify-content-between align-items-end align-items-lg-center mb-4 p-0 --mw-1170" action type id="diet_search">
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
<link rel="stylesheet" href="{{ mix('css/app.css') }}">
|
||||
<script src="{{ mix('js/app.js') }}" defer></script>
|
||||
|
||||
@stack('css_head')
|
||||
<!-- Styles -->
|
||||
@livewireStyles
|
||||
</head>
|
||||
|
||||
@@ -2,6 +2,11 @@
|
||||
@php
|
||||
$typeToSvgId = ['slim' => '#SlimBig', 'fit' => '#FitBig', 'wellness' => '#WellnessBig', 'behavior' => '#BehaviorBig'];
|
||||
@endphp
|
||||
@push('css_head')
|
||||
<script src="https://cdn.tailwindcss.com"></script>
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" integrity="sha384-T3c6CoIi6uLrA9TneNEoa7RxnatzjcDSCmG1MXxSR1GAsXEV/Dwwykc2MPK8M2HN" crossorigin="anonymous">
|
||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.min.js" integrity="sha384-BBtl+eGJRgqQAUMxJ7pMwbEyER4l1g+O15P+16Ep7Q9Q+zqX6gSbd85u4mG4QzX+" crossorigin="anonymous"></script>
|
||||
@endpush
|
||||
@section('main_section')
|
||||
<section class="py-5" id="main">
|
||||
<form class="container d-block d-sm-flex justify-content-between align-items-end align-items-lg-center mb-4 p-0 --mw-1170" action="" type="">
|
||||
|
||||
@@ -1,5 +1,10 @@
|
||||
@extends('layouts/eatvio')
|
||||
@section('page_title', $user->name ." Profile")
|
||||
@push('css_head')
|
||||
<script src="https://cdn.tailwindcss.com"></script>
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" integrity="sha384-T3c6CoIi6uLrA9TneNEoa7RxnatzjcDSCmG1MXxSR1GAsXEV/Dwwykc2MPK8M2HN" crossorigin="anonymous">
|
||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.min.js" integrity="sha384-BBtl+eGJRgqQAUMxJ7pMwbEyER4l1g+O15P+16Ep7Q9Q+zqX6gSbd85u4mG4QzX+" crossorigin="anonymous"></script>
|
||||
@endpush
|
||||
@section('main_section')
|
||||
<section class="py-5" id="main">
|
||||
<div class="container d-flex justify-content-between align-items-center mb-5 px-4 py-4 --bg_white --shadow --radius --mw-1000">
|
||||
|
||||
@@ -3,7 +3,10 @@
|
||||
<livewire:recipe.list-view />
|
||||
@endsection
|
||||
@section('page_title', 'Recipes list')
|
||||
@push('jq_scripts')
|
||||
<script src="/js/bootstrap.min.js"></script>
|
||||
<script src="/js/bootstrap.bundle.min.js"></script>
|
||||
|
||||
@push('css_head')
|
||||
<script src="https://cdn.tailwindcss.com"></script>
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" integrity="sha384-T3c6CoIi6uLrA9TneNEoa7RxnatzjcDSCmG1MXxSR1GAsXEV/Dwwykc2MPK8M2HN" crossorigin="anonymous">
|
||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.min.js" integrity="sha384-BBtl+eGJRgqQAUMxJ7pMwbEyER4l1g+O15P+16Ep7Q9Q+zqX6gSbd85u4mG4QzX+" crossorigin="anonymous"></script>
|
||||
@endpush
|
||||
|
||||
|
||||
@@ -1,105 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace Tests\Feature\Plan;
|
||||
use Illuminate\Http\UploadedFile;
|
||||
use Illuminate\Support\Facades\Storage;
|
||||
use Illuminate\Foundation\Testing\RefreshDatabase;
|
||||
use Livewire\Livewire;
|
||||
use Livewire\Features\SupportFileUploads\TemporaryUploadedFile;
|
||||
use App\Models\Recipe;
|
||||
use App\Models\User;
|
||||
use App\Livewire\Recipe\Edit;
|
||||
use Tests\TestCase;
|
||||
use Faker\Generator as Faker;
|
||||
|
||||
class RecipeEditTest extends TestCase
|
||||
|
||||
{
|
||||
use RefreshDatabase;
|
||||
|
||||
|
||||
public function can_update_recipe()
|
||||
{
|
||||
Storage::fake('public');
|
||||
$faker = Factory::create('ru_RU');
|
||||
$user = User::factory()->create();
|
||||
$recipe = Recipe::factory()->create([
|
||||
'steps' => [],
|
||||
'ingredients' => [],
|
||||
]);
|
||||
$tag1 = Tag::factory()->create();
|
||||
$tag2 = Tag::factory()->create();
|
||||
|
||||
$title = $faker->sentence(3);
|
||||
$description = $faker->paragraph(2);
|
||||
$cooking_time = $faker->numberBetween(10, 120);
|
||||
$type = $faker->randomElement(['Main Dish', 'Dessert', 'Appetizer']);
|
||||
$video_url = $faker->url;
|
||||
$image = UploadedFile::fake()->image('new_image.jpg');
|
||||
$ingredients_names = [$faker->word, $faker->word, $faker->word];
|
||||
$ingredients_portions = [$faker->numberBetween(1, 500), $faker->numberBetween(1, 500), $faker->numberBetween(1, 500)];
|
||||
$ingredient_units = [$faker->randomElement(['gr', 'ml', 'pcs']), $faker->randomElement(['gr', 'ml', 'pcs']), $faker->randomElement(['gr', 'ml', 'pcs'])];
|
||||
|
||||
Livewire::actingAs($user)
|
||||
->test('recipe.edit', ['recipe' => $recipe])
|
||||
->set('title', $title)
|
||||
->set('description', $description)
|
||||
->set('cooking_time', $cooking_time)
|
||||
->set('type', $type)
|
||||
->set('video_url', $video_url)
|
||||
->set('image', $image)
|
||||
->set('tags', [$tag1->id, $tag2->id])
|
||||
->call('addIngredient')
|
||||
->set('ingredients_name.0', $ingredients_names[0])
|
||||
->set('ingredients_portion.0', $ingredients_portions[0])
|
||||
->set('ingredients_unit.0', $ingredient_units[0])
|
||||
->call('addIngredient')
|
||||
->set('ingredients_name.1', $ingredients_names[1])
|
||||
->set('ingredients_portion.1', $ingredients_portions[1])
|
||||
->set('ingredients_unit.1', $ingredient_units[1])
|
||||
->call('addIngredient')
|
||||
->set('ingredients_name.2', $ingredients_names[2])
|
||||
->set('ingredients_portion.2', $ingredients_portions[2])
|
||||
->set('ingredients_unit.2', $ingredient_units[2])
|
||||
->call('addStep')
|
||||
->set('steps.0.description', $faker->paragraph)
|
||||
->set('steps.0.image', UploadedFile::fake()->image('new_step_image0.jpg'))
|
||||
->call('addStep')
|
||||
->set('steps.1.description', $faker->paragraph)
|
||||
->set('steps.1.image', UploadedFile::fake()->image('new_step_image1.jpg'))
|
||||
->call('addStep')
|
||||
->set('steps.2.description', $faker->paragraph)
|
||||
->set('steps.2.image', UploadedFile::fake()->image('new_step_image2.jpg'))
|
||||
->call('publish');
|
||||
|
||||
$this->assertDatabaseHas('recipes', [
|
||||
'title' => $title,
|
||||
'description' => $description,
|
||||
'cooking_time' => $cooking_time,
|
||||
'type' => $type,
|
||||
'video_url' => $video_url,
|
||||
'image' => $image,
|
||||
'ingredients_name.0' => $ingredients_names[0],
|
||||
'ingredients_portion.0' => $ingredients_portions[0],
|
||||
'ingredients_unit.0' => $ingredient_units[0],
|
||||
'ingredients_name.1' => $ingredients_names[1],
|
||||
'ingredients_portion.1' => $ingredients_portions[1],
|
||||
'ingredients_unit.1' => $ingredient_units[1],
|
||||
'ingredients_name.2' => $ingredients_names[2],
|
||||
'ingredients_portion.2' => $ingredients_portions[2],
|
||||
'ingredients_unit.2' => $ingredient_units[2],
|
||||
]);
|
||||
|
||||
$this->assertDatabaseHas('tags', [
|
||||
'id' => $tag1->id,
|
||||
]);
|
||||
$this->assertDatabaseHas('tags', [
|
||||
'id' => $tag2->id,
|
||||
]);
|
||||
|
||||
Storage::disk('public')->assertExists('recipes/new_image.jpg');
|
||||
Storage::disk('public')->assertExists('steps/new_step_image0.jpg');
|
||||
Storage::disk('public')->assertExists('steps/new_step_image1.jpg');
|
||||
Storage::disk('public')->assertExists('steps/new_step_image2.jpg');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user