From edcb3fde77eadfccf841ab970563aa4f6d392fd5 Mon Sep 17 00:00:00 2001 From: roble Date: Tue, 10 Nov 2026 11:24:06 +0000 Subject: [PATCH 1/4] test: assert behaviour, not copy or design Customers translate, reword and restyle a starter kit; tests now check test ids, data-state, URLs, counts and the data they create. Co-Authored-By: Claude Opus 5.5 --- resources/js/react/components/ItemCard.tsx | 1 + resources/js/vue/components/ItemCard.vue | 1 + tests/e2e/tests/roadmap.spec.ts | 11 +++-------- 3 files changed, 5 insertions(+), 8 deletions(-) diff --git a/resources/js/react/components/ItemCard.tsx b/resources/js/react/components/ItemCard.tsx index 06ecd35..50596e2 100644 --- a/resources/js/react/components/ItemCard.tsx +++ b/resources/js/react/components/ItemCard.tsx @@ -60,6 +60,7 @@ export default function ItemCard({ variant="secondary" className="text-xs" data-testid={`item-status-${item.id}`} + data-state={item.status} > {item.status_label} diff --git a/resources/js/vue/components/ItemCard.vue b/resources/js/vue/components/ItemCard.vue index f8737ac..a8d31f1 100644 --- a/resources/js/vue/components/ItemCard.vue +++ b/resources/js/vue/components/ItemCard.vue @@ -55,6 +55,7 @@ defineEmits<{ vote: [item: RoadmapItem] }>(); variant="secondary" class="text-xs" :data-testid="`item-status-${item.id}`" + :data-state="item.status" > {{ item.status_label }} diff --git a/tests/e2e/tests/roadmap.spec.ts b/tests/e2e/tests/roadmap.spec.ts index 6da3b4b..fa5b1bb 100644 --- a/tests/e2e/tests/roadmap.spec.ts +++ b/tests/e2e/tests/roadmap.spec.ts @@ -178,19 +178,12 @@ test.describe('Roadmap', () => { await expect(panel.getByTestId(`vote-count-${item.id}`)).toHaveText( '1', ); - // Toasts stack (sign-in, then each vote): look a toast up by its text. - await expect( - page.locator('[data-sonner-toast]', { hasText: 'Upvoted!' }), - ).toBeVisible(); await expect(panel).toBeVisible(); await expect(page).toHaveURL(new RegExp(`/roadmap/${item.slug}$`)); const card = page.getByTestId(`roadmap-item-${item.id}`); await expect(card.getByTestId(`vote-count-${item.id}`)).toHaveText('1'); await panel.getByTestId(`vote-btn-${item.id}`).click(); - await expect( - page.locator('[data-sonner-toast]', { hasText: 'Vote removed' }), - ).toBeVisible(); await expect(panel).toBeVisible(); await expect(page).toHaveURL(new RegExp(`/roadmap/${item.slug}$`)); await expect(panel.getByTestId(`vote-count-${item.id}`)).toHaveText( @@ -315,7 +308,9 @@ test.describe('Roadmap', () => { await page.getByTestId('filter-mine').click(); const mine = page.getByTestId('roadmap-mine'); await expect(mine).toContainText('Export to CSV'); - await expect(mine).toContainText('Under Review'); + await expect( + mine.locator('[data-testid^="item-status-"]'), + ).toHaveAttribute('data-state', 'under_review'); await page.getByTestId('filter-mine-back').click(); await expect(page.getByTestId('roadmap-board')).toBeVisible(); From a72e42f3b0fa1b2ca10178e209c510c3096e03d7 Mon Sep 17 00:00:00 2001 From: roble Date: Tue, 10 Nov 2026 16:10:56 +0000 Subject: [PATCH 2/4] refactor: demo seeders become the showcase state Demo*Seeder is now Showcase*, run by modules:seed --state=showcase. Co-Authored-By: Claude Opus 5.5 --- README.md | 2 +- Taskfile.yml | 4 ++-- ...tabaseSeeder.php => ShowcaseRoadmapDatabaseSeeder.php} | 2 +- .../Feature/{DemoStaffTest.php => ShowcaseStaffTest.php} | 8 ++++---- 4 files changed, 8 insertions(+), 8 deletions(-) rename database/seeders/{DemoRoadmapDatabaseSeeder.php => ShowcaseRoadmapDatabaseSeeder.php} (99%) rename tests/Feature/{DemoStaffTest.php => ShowcaseStaffTest.php} (79%) diff --git a/README.md b/README.md index 147e474..f096c95 100644 --- a/README.md +++ b/README.md @@ -50,7 +50,7 @@ One switch in the admin panel, under **Settings → Roadmap**: whether comments ## Demo data ```bash -php artisan modules:seed --module=roadmap --demo +php artisan modules:seed --module=roadmap --state=showcase ``` Adds sample items with votes and comments from sample users, and a staff account (`roadmap@saucebase.dev`) that only sees the roadmap in the admin. All use the `DEMO_PASSWORD` from `.env`. diff --git a/Taskfile.yml b/Taskfile.yml index e288c1f..218f501 100644 --- a/Taskfile.yml +++ b/Taskfile.yml @@ -14,9 +14,9 @@ tasks: # ── Database ────────────────────────────────────────────────── - db:seed:demo: + db:seed:showcase: desc: Seed the Roadmap module with sample content - cmd: '{{.APP}} php artisan modules:seed --module=roadmap --demo' + cmd: '{{.APP}} php artisan modules:seed --module=roadmap --state=showcase' # ── Code Generation ──────────────────────────────────────────── diff --git a/database/seeders/DemoRoadmapDatabaseSeeder.php b/database/seeders/ShowcaseRoadmapDatabaseSeeder.php similarity index 99% rename from database/seeders/DemoRoadmapDatabaseSeeder.php rename to database/seeders/ShowcaseRoadmapDatabaseSeeder.php index 7d2f599..6dea187 100644 --- a/database/seeders/DemoRoadmapDatabaseSeeder.php +++ b/database/seeders/ShowcaseRoadmapDatabaseSeeder.php @@ -9,7 +9,7 @@ use Modules\Roadmap\Models\RoadmapItem; use Spatie\Permission\Models\Role; -class DemoRoadmapDatabaseSeeder extends Seeder +class ShowcaseRoadmapDatabaseSeeder extends Seeder { public function run(): void { diff --git a/tests/Feature/DemoStaffTest.php b/tests/Feature/ShowcaseStaffTest.php similarity index 79% rename from tests/Feature/DemoStaffTest.php rename to tests/Feature/ShowcaseStaffTest.php index 70ff37b..e61c105 100644 --- a/tests/Feature/DemoStaffTest.php +++ b/tests/Feature/ShowcaseStaffTest.php @@ -6,20 +6,20 @@ use Illuminate\Foundation\Testing\RefreshDatabase; use Illuminate\Support\Facades\Hash; use Modules\Roadmap\Database\Seeders\DatabaseSeeder; -use Modules\Roadmap\Database\Seeders\DemoRoadmapDatabaseSeeder; +use Modules\Roadmap\Database\Seeders\ShowcaseRoadmapDatabaseSeeder; use Tests\TestCase; /** * The demo ships a staff account for this module's admin area, so visitors can try a * role that sees only part of the panel. */ -class DemoStaffTest extends TestCase +class ShowcaseStaffTest extends TestCase { use RefreshDatabase; public function test_the_demo_adds_a_staff_account_for_this_module_only(): void { - $this->seed([DatabaseSeeder::class, DemoRoadmapDatabaseSeeder::class]); + $this->seed([DatabaseSeeder::class, ShowcaseRoadmapDatabaseSeeder::class]); $staff = User::where('email', 'roadmap@saucebase.dev')->firstOrFail(); @@ -31,7 +31,7 @@ public function test_demo_accounts_use_the_configured_demo_password(): void { config(['saucebase.demo_password' => 'not-the-old-default']); - $this->seed([DatabaseSeeder::class, DemoRoadmapDatabaseSeeder::class]); + $this->seed([DatabaseSeeder::class, ShowcaseRoadmapDatabaseSeeder::class]); $this->assertTrue(Hash::check('not-the-old-default', User::where('email', 'roadmap@saucebase.dev')->value('password'))); } From 2f257926aeb8ffe597d40cbe4892b43f77e3c745 Mon Sep 17 00:00:00 2001 From: roble Date: Tue, 10 Nov 2026 20:40:53 +0000 Subject: [PATCH 3/4] chore: alias the dev branch as 3.6.x-dev Co-Authored-By: Claude Opus 5.5 --- composer.json | 3 +++ 1 file changed, 3 insertions(+) diff --git a/composer.json b/composer.json index c5345f6..1126b0a 100644 --- a/composer.json +++ b/composer.json @@ -25,6 +25,9 @@ "vue", "react" ] + }, + "branch-alias": { + "dev-dev": "3.6.x-dev" } }, "autoload": { From 87334524e437cf82f15f06895d00512f77c57150 Mon Sep 17 00:00:00 2001 From: roble Date: Sun, 15 Nov 2026 18:55:55 +0000 Subject: [PATCH 4/4] chore: require saucebase/core ^3.0 Co-Authored-By: Claude Opus 5.5 --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 1126b0a..0c952d5 100644 --- a/composer.json +++ b/composer.json @@ -5,7 +5,7 @@ "license": "MIT", "version": "v3.5.1", "require": { - "saucebase/core": "^2.8" + "saucebase/core": "^3.0" }, "authors": [ {