Skip to content

Commit bcb89c6

Browse files
committed
Fix test
1 parent 4455c6c commit bcb89c6

File tree

2 files changed

+30
-2
lines changed

2 files changed

+30
-2
lines changed

tests/Feature/SseTest.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66

77
use putyourlightson\datastar\Datastar;
88
use putyourlightson\datastar\services\SseService;
9-
use yii\web\BadRequestHttpException;
109

1110
beforeEach(function() {
1211
Datastar::getInstance()->set('sse', SseService::class);
@@ -34,4 +33,4 @@
3433
test('Test that calling an SSE method when another one is in process throws an exception', function() {
3534
Datastar::getInstance()->sse->setSseMethodInProcess('patchElements');
3635
Datastar::getInstance()->sse->patchSignals([]);
37-
})->throws(BadRequestHttpException::class);
36+
})->throws(Exception::class);

tests/TESTS.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,15 @@ This document outlines the test specification for the Datastar module.
44

55
---
66

7+
## Architecture Tests
8+
9+
### [Architecture](Architecture/ArchitectureTest.php)
10+
11+
_Tests the architecture of the plugin._
12+
13+
![Pass](https://raw.githubusercontent.com/putyourlightson/craft-generate-test-spec/main/icons/pass.svg) Source code does not contain any `Craft::dd` statements.
14+
![Pass](https://raw.githubusercontent.com/putyourlightson/craft-generate-test-spec/main/icons/pass.svg) Source code does not contain any `var_dump` or `die` statements.
15+
716
## Feature Tests
817

918
### [Action](Feature/ActionTest.php)
@@ -13,3 +22,23 @@ _Tests the Datastar action helper._
1322
![Pass](https://raw.githubusercontent.com/putyourlightson/craft-generate-test-spec/main/icons/pass.svg) Test creating an action containing an array of primitive params.
1423
![Pass](https://raw.githubusercontent.com/putyourlightson/craft-generate-test-spec/main/icons/pass.svg) Test creating an action containing an array of options.
1524
![Pass](https://raw.githubusercontent.com/putyourlightson/craft-generate-test-spec/main/icons/pass.svg) Test creating an action containing an options string.
25+
26+
### [AssetBundle](Feature/AssetBundleTest.php)
27+
28+
_Tests the Datastar asset bundle._
29+
30+
![Pass](https://raw.githubusercontent.com/putyourlightson/craft-generate-test-spec/main/icons/pass.svg) Test that the asset bundle uses the correct version.
31+
32+
### [Config](Feature/ConfigTest.php)
33+
34+
_Tests the Datastar config model._
35+
36+
![Pass](https://raw.githubusercontent.com/putyourlightson/craft-generate-test-spec/main/icons/pass.svg) Test that creating a config model containing the signals variable name throws an exception.
37+
![Pass](https://raw.githubusercontent.com/putyourlightson/craft-generate-test-spec/main/icons/pass.svg) Test that creating a config model containing an object param throws an exception.
38+
39+
### [Sse](Feature/SseTest.php)
40+
41+
_Tests the SSE service._
42+
43+
![Pass](https://raw.githubusercontent.com/putyourlightson/craft-generate-test-spec/main/icons/pass.svg) Test remove elements tag.
44+
![Pass](https://raw.githubusercontent.com/putyourlightson/craft-generate-test-spec/main/icons/pass.svg) Test that calling an SSE method when another one is in process throws an exception.

0 commit comments

Comments
 (0)