mirror of
https://github.com/Redocly/redoc.git
synced 2024-11-28 03:23:44 +03:00
Merge branch 'master' into releases
This commit is contained in:
commit
ffd9cb5510
|
@ -37,11 +37,13 @@ deploy:
|
|||
script: ./build/deploy_gh_pages.sh
|
||||
on:
|
||||
branch: master
|
||||
condition: $JOB != e2e
|
||||
- skip_cleanup: true
|
||||
provider: script
|
||||
script: npm run branch-release
|
||||
on:
|
||||
branch: master
|
||||
condition: $JOB != e2e
|
||||
- provider: npm
|
||||
skip_cleanup: true
|
||||
email: gotsijroman@gmail.com
|
||||
|
|
|
@ -37,13 +37,13 @@ describe('Redoc components', () => {
|
|||
});
|
||||
|
||||
|
||||
it('shold init component data', () => {
|
||||
it('should init component data', () => {
|
||||
expect(component).not.toBeNull();
|
||||
expect(component.data).not.toBeNull();
|
||||
component.data.title.should.be.equal('Swagger Petstore');
|
||||
});
|
||||
|
||||
it('shold render api name and version', () => {
|
||||
it('should render api name and version', () => {
|
||||
let nativeElement = getChildDebugElement(fixture.debugElement, 'api-info').nativeElement;
|
||||
let headerElement = nativeElement.querySelector('h1');
|
||||
expect(headerElement).toHaveText('Swagger Petstore (1.0.0)');
|
||||
|
|
|
@ -1,6 +1,12 @@
|
|||
@import '../../common/styles/variables';
|
||||
@import '../../common/styles/share-link';
|
||||
|
||||
:host {
|
||||
padding-bottom: 100px;
|
||||
display: block;
|
||||
border-bottom: 2px solid rgba(127, 127, 127, 0.25);
|
||||
}
|
||||
|
||||
responses-list, params-list {
|
||||
display: block;
|
||||
}
|
||||
|
@ -71,6 +77,7 @@ responses-list, params-list {
|
|||
color: $sample-panel-color;
|
||||
width: 40%;
|
||||
padding: 10px 20px;
|
||||
background: $samples-panel-bg-color;
|
||||
}
|
||||
|
||||
responses-samples {
|
||||
|
@ -128,3 +135,21 @@ responses-samples {
|
|||
.http-method.head {
|
||||
background-color: darkkhaki;
|
||||
}
|
||||
|
||||
@media (max-width: 1100px) {
|
||||
.methods:before {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.method-samples, .method-content {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.method-samples {
|
||||
margin-top: 2em;
|
||||
}
|
||||
|
||||
:host {
|
||||
padding-bottom: 0;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,12 +1,6 @@
|
|||
@import '../../common/styles/variables';
|
||||
@import '../../common/styles/share-link';
|
||||
|
||||
method {
|
||||
padding-bottom: 100px;
|
||||
display: block;
|
||||
border-bottom: 2px solid rgba(127, 127, 127, 0.25);
|
||||
}
|
||||
|
||||
.tag-info {
|
||||
padding: 0 20px;
|
||||
box-sizing: border-box;
|
||||
|
@ -39,3 +33,9 @@ method {
|
|||
position: absolute;
|
||||
z-index: -1;
|
||||
}
|
||||
|
||||
@media (max-width: 1100px) {
|
||||
.methods:before {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"name": "redoc",
|
||||
"description": "Swagger-generated API Reference Documentation",
|
||||
"version": "0.2.0",
|
||||
"version": "0.3.0",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git://github.com/Rebilly/ReDoc"
|
||||
|
|
|
@ -82,9 +82,21 @@ function fixFFTest(done) {
|
|||
})
|
||||
}
|
||||
|
||||
/* picks each n-th property from object */
|
||||
function eachNth(obj, n) {
|
||||
let res = {};
|
||||
Object.keys(obj).forEach((k, idx) => {
|
||||
if (idx % n === 0) {
|
||||
res[k] = obj[k];
|
||||
}
|
||||
});
|
||||
return res;
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
loadJson: loadJson,
|
||||
verifyNoBrowserErrors: verifyNoBrowserErrors,
|
||||
scrollToEl: scrollToEl,
|
||||
fixFFTest: fixFFTest
|
||||
fixFFTest: fixFFTest,
|
||||
eachNth: eachNth
|
||||
}
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
const verifyNoBrowserErrors = require('./helpers').verifyNoBrowserErrors;
|
||||
const scrollToEl = require('./helpers').scrollToEl;
|
||||
const fixFFTest = require('./helpers').fixFFTest;
|
||||
const eachNth = require('./helpers').eachNth;
|
||||
|
||||
const URL = 'index.html';
|
||||
|
||||
|
@ -35,7 +36,7 @@ basicTests(null, 'Extended Petstore');
|
|||
|
||||
describe('Scroll sync', () => {
|
||||
let specUrl = URL;
|
||||
|
||||
|
||||
beforeEach((done) => {
|
||||
browser.get(specUrl);
|
||||
fixFFTest(done);
|
||||
|
@ -59,6 +60,14 @@ describe('APIs.guru specs test', ()=> {
|
|||
delete apisGuruList['googleapis.com:mirror']; // bad urls in images
|
||||
delete apisGuruList['googleapis.com:discovery']; // non-string references
|
||||
|
||||
// run quick version of e2e test on all builds except releases
|
||||
if (process.env.TRAVIS && !process.env.TRAVIS_TAG) {
|
||||
console.log('Running on short APIs guru list');
|
||||
apisGuruList = eachNth(apisGuruList, 10);
|
||||
} else {
|
||||
console.log('Running on full APIs guru list')
|
||||
}
|
||||
|
||||
for (let apiName of Object.keys(apisGuruList)) {
|
||||
let apiInfo = apisGuruList[apiName].versions[apisGuruList[apiName].preferred];
|
||||
let url = apiInfo.swaggerUrl;
|
||||
|
|
Loading…
Reference in New Issue
Block a user