added new browser tests for editor, now with pathched tests

This commit is contained in:
Mark Gregory
2026-06-25 08:08:05 +01:00
parent b440888ac1
commit 41d0c9b2d1
6 changed files with 85 additions and 11 deletions
+1 -1
View File
@@ -784,7 +784,7 @@ final class TicketShow extends Component
private function gitCommitLikeOperator(): string
{
return \Modules\Helpdesk\Models\GitCommit::query()->getConnection()->getDriverName() === 'pgsql'
? $this->gitCommitLikeOperator()
? 'ILIKE'
: 'LIKE';
}
@@ -55,37 +55,37 @@
</label>
<div class="overflow-hidden rounded-2xl border border-zinc-700 bg-zinc-950 shadow-sm">
<div class="flex flex-wrap items-center gap-1.5 border-b border-zinc-700 bg-zinc-900/80 px-4 py-2 text-sm text-zinc-300">
<div class="flex flex-wrap items-center gap-1.5 border-b border-zinc-700 bg-zinc-900/80 px-4 py-2 text-sm text-zinc-300" data-helpdesk-editor-toolbar>
<span class="mr-2 rounded-lg bg-zinc-800 px-2 py-1 text-xs font-black uppercase tracking-wide text-zinc-100">Spellcheck enabled</span>
<button type="button" x-on:click="runCommand('bold')"
<button type="button" x-on:click="runCommand('bold')" data-helpdesk-editor-command="bold"
class="inline-flex min-h-8 items-center justify-center rounded-lg border border-zinc-700 bg-zinc-950 px-3 py-1.5 text-xs font-black text-zinc-100 shadow-sm transition hover:bg-zinc-800 focus:outline-none focus:ring-2 focus:ring-blue-400/70"
aria-label="Bold selected text">
B
</button>
<button type="button" x-on:click="runCommand('italic')"
<button type="button" x-on:click="runCommand('italic')" data-helpdesk-editor-command="italic"
class="inline-flex min-h-8 items-center justify-center rounded-lg border border-zinc-700 bg-zinc-950 px-3 py-1.5 text-xs font-black italic text-zinc-100 shadow-sm transition hover:bg-zinc-800 focus:outline-none focus:ring-2 focus:ring-blue-400/70"
aria-label="Italic selected text">
I
</button>
<button type="button" x-on:click="runCommand('underline')"
<button type="button" x-on:click="runCommand('underline')" data-helpdesk-editor-command="underline"
class="inline-flex min-h-8 items-center justify-center rounded-lg border border-zinc-700 bg-zinc-950 px-3 py-1.5 text-xs font-black underline text-zinc-100 shadow-sm transition hover:bg-zinc-800 focus:outline-none focus:ring-2 focus:ring-blue-400/70"
aria-label="Underline selected text">
U
</button>
<button type="button" x-on:click="runCommand('insertUnorderedList')"
<button type="button" x-on:click="runCommand('insertUnorderedList')" data-helpdesk-editor-command="insertUnorderedList"
class="inline-flex min-h-8 items-center justify-center rounded-lg border border-zinc-700 bg-zinc-950 px-3 py-1.5 text-xs font-black text-zinc-100 shadow-sm transition hover:bg-zinc-800 focus:outline-none focus:ring-2 focus:ring-blue-400/70">
• List
</button>
<button type="button" x-on:click="runCommand('insertOrderedList')"
<button type="button" x-on:click="runCommand('insertOrderedList')" data-helpdesk-editor-command="insertOrderedList"
class="inline-flex min-h-8 items-center justify-center rounded-lg border border-zinc-700 bg-zinc-950 px-3 py-1.5 text-xs font-black text-zinc-100 shadow-sm transition hover:bg-zinc-800 focus:outline-none focus:ring-2 focus:ring-blue-400/70">
1. List
</button>
<button type="button" x-on:click="wrapBlock('blockquote')"
<button type="button" x-on:click="wrapBlock('blockquote')" data-helpdesk-editor-command="blockquote"
class="inline-flex min-h-8 items-center justify-center rounded-lg border border-zinc-700 bg-zinc-950 px-3 py-1.5 text-xs font-black text-zinc-100 shadow-sm transition hover:bg-zinc-800 focus:outline-none focus:ring-2 focus:ring-blue-400/70">
Quote
</button>
<button type="button" x-on:click="wrapBlock('pre')"
<button type="button" x-on:click="wrapBlock('pre')" data-helpdesk-editor-command="pre"
class="inline-flex min-h-8 items-center justify-center rounded-lg border border-zinc-700 bg-zinc-950 px-3 py-1.5 text-xs font-black text-zinc-100 shadow-sm transition hover:bg-zinc-800 focus:outline-none focus:ring-2 focus:ring-blue-400/70">
Code
</button>
@@ -104,6 +104,7 @@
role="textbox"
aria-multiline="true"
data-placeholder="{{ $placeholder }}"
data-wire-model="{{ $model }}"
@if ($editorDusk) data-dusk="{{ $editorDusk }}" dusk="{{ $editorDusk }}" @endif
x-on:blur="syncToLivewire(false)"
class="helpdesk-rich-editor block min-h-[14rem] w-full overflow-y-auto whitespace-pre-wrap break-words border-0 bg-zinc-950 px-5 py-4 text-base leading-7 text-zinc-100 outline-none transition placeholder:text-zinc-500 empty:before:pointer-events-none empty:before:text-zinc-500 empty:before:content-[attr(data-placeholder)] focus:ring-2 focus:ring-blue-500"
@@ -342,7 +342,8 @@
</button>
<a href="{{ route('helpdesk.tickets.index') }}" wire:navigate
class="inline-flex min-h-10 items-center justify-center rounded-lg bg-blue-600 px-4 py-2 text-xs font-black text-white shadow-sm transition hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-blue-400/70">
class="inline-flex min-h-10 items-center justify-center rounded-lg bg-blue-600 px-4 py-2 text-xs font-black text-white shadow-sm transition hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-blue-400/70"
data-dusk="ticket-create-cancel" dusk="ticket-create-cancel">
<i class="fa-solid fa-arrow-left mr-2" aria-hidden="true"></i>
Cancel
</a>
+10
View File
@@ -540,3 +540,13 @@
version: 0.0.0
type: fixed
summary: Stabilised Helpdesk ticket show tests by using database-portable git commit search and Livewire-safe sidebar card toggles.
- version: 1.10.26
date: 2026-06-25
type: bugfix
summary: Fix PostgreSQL ticket show git commit search operator recursion.
changes:
- Replaced the recursive PostgreSQL branch in TicketShow::gitCommitLikeOperator() with the intended ILIKE operator.
- Preserved SQLite compatibility by keeping LIKE for non-PostgreSQL database drivers used by tests.
- Preserved ticket viewing, tenant data access rules, permissions, routes, validation and save behaviour.
- Preserved append-only changelog history.
+1 -1
View File
@@ -23,5 +23,5 @@
"Modules\\Helpdesk\\Providers\\HelpdeskServiceProvider"
],
"files": [],
"version": "1.10.25"
"version": "1.10.26"
}
Executable
+62
View File
@@ -0,0 +1,62 @@
#!/usr/bin/env bash
###############################################################################
# Project Copy Script
#
# Copies a project while excluding generated and local-only directories.
#
# Excludes:
# - vendor/
# - node_modules/
# - .git/
# - storage/
# - bootstrap/cache/
# - provision/
#
# Usage:
# ./copy-project.sh /path/to/source /path/to/destination
#
###############################################################################
set -euo pipefail
if [ "$#" -ne 2 ]; then
echo "Usage:"
echo " $0 <source> <destination>"
exit 1
fi
SOURCE="$(cd "$1" && pwd)"
DEST="$2"
echo "Source : $SOURCE"
echo "Destination : $DEST"
echo
mkdir -p "$DEST"
echo "Copying..."
rsync -a \
--progress \
--delete \
--exclude=".git/" \
--exclude="vendor/" \
--exclude="node_modules/" \
--exclude="storage/" \
--exclude="bootstrap/cache/" \
--exclude="provision/" \
"$SOURCE/" \
"$DEST/"
echo
echo "Creating required empty directories..."
mkdir -p "$DEST/storage"
mkdir -p "$DEST/bootstrap/cache"
touch "$DEST/storage/.gitkeep"
touch "$DEST/bootstrap/cache/.gitkeep"
echo
echo "Done."