Skip to content

Commit

Permalink
Merge pull request hoppscotch#531 from liyasthomas/enhancements
Browse files Browse the repository at this point in the history
Enhancements
  • Loading branch information
liyasthomas authored Jan 28, 2020
2 parents d2bf0b7 + f93fc4c commit d707ba3
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 20 deletions.
4 changes: 4 additions & 0 deletions assets/css/styles.scss
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,10 @@ h4 {
font-weight: 700;
}

hr {
border-bottom: 1px dashed var(--brd-color);
}

.tooltip {
$bgcolor: var(--tt-color);
$fgcolor: var(--fg-color);
Expand Down
16 changes: 8 additions & 8 deletions functions/postwomanTesting.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const styles = {
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) {
let pw = {
Expand Down Expand Up @@ -51,7 +51,7 @@ function test(descriptor, func, _testReports) {
}
_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
}

Expand Down Expand Up @@ -113,10 +113,10 @@ class Expectation {
);
}
toBeLevel2xx() {
let code = parseInt(this.expectValue);
const code = parseInt(this.expectValue);
if (Number.isNaN(code)) {
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)
Expand All @@ -128,7 +128,7 @@ class Expectation {
);
}
toBeLevel3xx() {
let code = parseInt(this.expectValue);
const code = parseInt(this.expectValue);
if (Number.isNaN(code)) {
return this._fail(
`Expected 300-level status but could not parse value ${this.expectValue}`
Expand All @@ -143,7 +143,7 @@ class Expectation {
);
}
toBeLevel4xx() {
let code = parseInt(this.expectValue);
const code = parseInt(this.expectValue);
if (Number.isNaN(code)) {
return this._fail(
`Expected 400-level status but could not parse value ${this.expectValue}`
Expand All @@ -158,10 +158,10 @@ class Expectation {
);
}
toBeLevel5xx() {
let code = parseInt(this.expectValue);
const code = parseInt(this.expectValue);
if (Number.isNaN(code)) {
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)
Expand Down
22 changes: 10 additions & 12 deletions pages/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -381,23 +381,21 @@
</div>
</div>
<div v-for="testReport in testReports">
<div v-if="testReport.result" class="flex-wrap">
<span :class="testReport.styles.class" class="info">
<div v-if="testReport.startBlock" 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">
{{ testReport.styles.icon }}
</i>
<span>&nbsp; {{ testReport.result }}</span>
<span v-if="testReport.message">
<label>&nbsp;&nbsp; {{ testReport.message }}</label>
</span>
</span>
<ul v-if="testReport.message">
<li>
<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>
</p>
<div v-else-if="testReport.endBlock"><hr /></div>
</div>
</div>
</li>
Expand Down

0 comments on commit d707ba3

Please sign in to comment.