fase(20): visual regression refactor
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
23
dist/modules/visual-regression/domain/value-objects/ComparisonStatus.js
vendored
Normal file
23
dist/modules/visual-regression/domain/value-objects/ComparisonStatus.js
vendored
Normal file
@@ -0,0 +1,23 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.ComparisonStatus = void 0;
|
||||
const ValueObject_1 = require("../../../../shared/domain/ValueObject");
|
||||
class ComparisonStatus extends ValueObject_1.ValueObject {
|
||||
get value() {
|
||||
return this.props.value;
|
||||
}
|
||||
static passed() { return new ComparisonStatus({ value: 'passed' }); }
|
||||
static failed() { return new ComparisonStatus({ value: 'failed' }); }
|
||||
static newState() { return new ComparisonStatus({ value: 'new_state' }); }
|
||||
static pending() { return new ComparisonStatus({ value: 'pending' }); }
|
||||
static from(value) {
|
||||
if (!['passed', 'failed', 'new_state', 'pending'].includes(value)) {
|
||||
throw new Error(`Invalid comparison status: ${value}`);
|
||||
}
|
||||
return new ComparisonStatus({ value: value });
|
||||
}
|
||||
isPassed() { return this.props.value === 'passed'; }
|
||||
isFailed() { return this.props.value === 'failed'; }
|
||||
isNewState() { return this.props.value === 'new_state'; }
|
||||
}
|
||||
exports.ComparisonStatus = ComparisonStatus;
|
||||
Reference in New Issue
Block a user