Skip to content

Commit

Permalink
#66 - tests fix
Browse files Browse the repository at this point in the history
  • Loading branch information
kamilpiech97 committed Aug 8, 2024
1 parent b690eb6 commit 60e4d19
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 11 deletions.
2 changes: 1 addition & 1 deletion app/Http/Controllers/Dashboard/SettingController.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public function removeLogo(): RedirectResponse
$settings = Setting::query()->firstOrFail();

if ($settings->logo) {
Storage::disk("public")->delete($settings->logo);
$res = Storage::disk("public")->delete($settings->logo);
$settings->logo = null;
$settings->save();

Expand Down
15 changes: 5 additions & 10 deletions resources/js/Pages/Dashboard/Setting/Edit.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ import { useForm } from '@inertiajs/inertia-vue3'
import FormError from '@/Shared/Forms/FormError.vue'
import ManagementHeader from '@/Shared/Components/ManagementHeader.vue'
import ManagementHeaderItem from '@/Shared/Components/ManagementHeaderItem.vue'
import ColorInput from "../../../Shared/Forms/ColorInput.vue";
import {ref} from "vue";
import {Method} from "@inertiajs/inertia";
import ColorInput from '../../../Shared/Forms/ColorInput.vue'
import { ref } from 'vue'
import { Method } from '@inertiajs/inertia'
const props = defineProps({
settings: Object,
Expand Down Expand Up @@ -39,11 +39,6 @@ function onFileSelected(event) {
imageUrl.value = URL.createObjectURL(event.target?.files[0])
form.errors.logo = ''
}
function deleteFile() {
form.logo = ''
imageUrl.value = ''
}
</script>
<template>
Expand Down Expand Up @@ -116,7 +111,7 @@ function deleteFile() {
Logo
</FormLabel>
<input
class="!mb-px block w-full border-0 border-b border-brand-light-gray p-2 text-sm font-medium text-brand-black hover:!mb-px hover:border-b-2 hover:border-brand-black focus:!mb-px focus:border-b-2 focus:border-brand-black focus:ring-0 focus:ring-offset-0"
class="border-brand-light-gray text-brand-black hover:border-brand-black focus:border-brand-black !mb-px block w-full border-0 border-b p-2 text-sm font-medium hover:!mb-px hover:border-b-2 focus:!mb-px focus:border-b-2 focus:ring-0 focus:ring-offset-0"
type="file" @input="onFileSelected"
>
<FormError :error="form.errors.logo" class="mt-2" />
Expand All @@ -128,8 +123,8 @@ function deleteFile() {
<InertiaLink
href="/dashboard/settings/remove-logo"
:method="Method.DELETE"
@click="form.logo = ''"
class="text-sm text-red-500 hover:text-red-700"
@click="form.logo = ''"
>
Usuń
</InertiaLink>
Expand Down
7 changes: 7 additions & 0 deletions tests/Feature/ExampleTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,13 @@

class ExampleTest extends TestCase
{
protected function tearDown(): void
{
Setting::query()->delete();

parent::tearDown();
}

public function testTheApplicationReturnsASuccessfulResponse(): void
{
Setting::factory()->create();
Expand Down

0 comments on commit 60e4d19

Please sign in to comment.