You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
An [OJS Plugin](https://docs.pkp.sfu.ca/dev/plugin-guide/en/) to streamline codechecking of submissions and display of [CODECHECK](https://codecheck.org.uk/) certificates.
@@ -119,6 +120,7 @@ The plugin tracks CODECHECK progress through a status system displayed in the re
119
120
### Status Implementation
120
121
121
122
The status is determined in `CodecheckReviewDisplay.vue` using the following logic:
123
+
122
124
```javascript
123
125
functiongetStatus() {
124
126
if (metadata.value.certificate&&metadata.value.checkTime) {
@@ -144,18 +146,21 @@ function getStatus() {
144
146
This plugin uses **Vite** for building Vue.js components.
145
147
146
148
#### Install dependencies
149
+
147
150
```bash
148
151
npm install
149
152
```
150
153
151
154
#### Build for production
155
+
152
156
```bash
153
157
npm run build
154
158
```
155
159
156
160
This compiles Vue components and JavaScript into the `public/` directory.
@@ -288,6 +294,68 @@ private function yourFunction(): void
288
294
}
289
295
```
290
296
297
+
## Running Tests
298
+
299
+
The plugin includes comprehensive test coverage for both backend PHP code and frontend Vue components.
300
+
301
+
### PHP Unit Tests
302
+
303
+
**Note:** Some tests require the full OJS environment (e.g.: database, facades, translations).
304
+
They run successfully in [**Option 2: Docker/CI Environment**](#option-2-dockerci-environment) but are skipped in [**Option 1: Local Testing**](#option-1-local-testing).
305
+
306
+
#### Option 1: Local Testing
307
+
308
+
From the plugins directory:
309
+
310
+
1. Navigate to the `tests/` directory:
311
+
```bash
312
+
cd plugins/generic/codecheck/tests/
313
+
```
314
+
2. Run the tests:
315
+
- **without** a test coverage report:
316
+
```bash
317
+
sh runTests.sh
318
+
```
319
+
or
320
+
```bash
321
+
sh runTests.sh --coverage-report=false
322
+
```
323
+
- **with** a test coverage report:
324
+
```bash
325
+
sh runTests.sh --coverage-report=true
326
+
```
327
+
**Note:** You will find the test coverage in the `tests/results/index.html` file.
0 commit comments