Merge pull request #531 from liyasthomas/enhancements

Enhancements
This commit is contained in:
Liyas Thomas
2020-01-28 06:11:47 +05:30
committed by GitHub
3 changed files with 22 additions and 20 deletions

View File

@@ -259,6 +259,10 @@ h4 {
font-weight: 700; font-weight: 700;
} }
hr {
border-bottom: 1px dashed var(--brd-color);
}
.tooltip { .tooltip {
$bgcolor: var(--tt-color); $bgcolor: var(--tt-color);
$fgcolor: var(--fg-color); $fgcolor: var(--fg-color);

View File

@@ -9,7 +9,7 @@ const styles = {
none: { icon: "", class: "" } none: { icon: "", class: "" }
}; };
//TODO: probably have to use a more global state for `test` // TODO: probably have to use a more global state for `test`
export default function runTestScriptWithVariables(script, variables) { export default function runTestScriptWithVariables(script, variables) {
let pw = { let pw = {
@@ -51,7 +51,7 @@ function test(descriptor, func, _testReports) {
} }
_testReports.push({ endBlock: true }); _testReports.push({ endBlock: true });
// TODO: Organieze and generate text report of each {descriptor: true} section in testReports. // TODO: Organize and generate text report of each {descriptor: true} section in testReports.
// add checkmark or x depending on if each testReport is pass=true or pass=false // add checkmark or x depending on if each testReport is pass=true or pass=false
} }
@@ -113,10 +113,10 @@ class Expectation {
); );
} }
toBeLevel2xx() { toBeLevel2xx() {
let code = parseInt(this.expectValue); const code = parseInt(this.expectValue);
if (Number.isNaN(code)) { if (Number.isNaN(code)) {
return this._fail( return this._fail(
`Expecteded 200-level status but could not parse value ${this.expectValue}` `Expected 200-level status but could not parse value ${this.expectValue}`
); );
} }
return this._satisfies(code >= 200 && code < 300) return this._satisfies(code >= 200 && code < 300)
@@ -128,7 +128,7 @@ class Expectation {
); );
} }
toBeLevel3xx() { toBeLevel3xx() {
let code = parseInt(this.expectValue); const code = parseInt(this.expectValue);
if (Number.isNaN(code)) { if (Number.isNaN(code)) {
return this._fail( return this._fail(
`Expected 300-level status but could not parse value ${this.expectValue}` `Expected 300-level status but could not parse value ${this.expectValue}`
@@ -143,7 +143,7 @@ class Expectation {
); );
} }
toBeLevel4xx() { toBeLevel4xx() {
let code = parseInt(this.expectValue); const code = parseInt(this.expectValue);
if (Number.isNaN(code)) { if (Number.isNaN(code)) {
return this._fail( return this._fail(
`Expected 400-level status but could not parse value ${this.expectValue}` `Expected 400-level status but could not parse value ${this.expectValue}`
@@ -158,10 +158,10 @@ class Expectation {
); );
} }
toBeLevel5xx() { toBeLevel5xx() {
let code = parseInt(this.expectValue); const code = parseInt(this.expectValue);
if (Number.isNaN(code)) { if (Number.isNaN(code)) {
return this._fail( return this._fail(
`Expected 200-level status but could not parse value ${this.expectValue}` `Expected 500-level status but could not parse value ${this.expectValue}`
); );
} }
return this._satisfies(code >= 500 && code < 600) return this._satisfies(code >= 500 && code < 600)

View File

@@ -381,23 +381,21 @@
</div> </div>
</div> </div>
<div v-for="testReport in testReports"> <div v-for="testReport in testReports">
<div v-if="testReport.result" class="flex-wrap"> <div v-if="testReport.startBlock" class="info">
<span :class="testReport.styles.class" class="info"> <h4>{{ testReport.startBlock }}</h4>
</div>
<p v-else-if="testReport.result" class="flex-wrap info">
<span :class="testReport.styles.class">
<i class="material-icons"> <i class="material-icons">
{{ testReport.styles.icon }} {{ testReport.styles.icon }}
</i> </i>
<span>&nbsp; {{ testReport.result }}</span> <span>&nbsp; {{ testReport.result }}</span>
<span v-if="testReport.message">
<label>&nbsp; &nbsp; {{ testReport.message }}</label>
</span>
</span> </span>
<ul v-if="testReport.message"> </p>
<li> <div v-else-if="testReport.endBlock"><hr /></div>
<label>{{ testReport.message }}</label>
</li>
</ul>
</div>
<div v-else-if="testReport.startBlock" class="info">
<h4>{{ testReport.startBlock }}</h4>
</div>
<div v-else-if="testReport.endBlock"><br /></div>
</div> </div>
</div> </div>
</li> </li>