mirror of
https://github.com/Redocly/redoc.git
synced 2025-08-07 21:54:53 +03:00
prefixed operation ids with parent id
This commit is contained in:
parent
ffa216ea87
commit
2b06692959
|
@ -30,7 +30,7 @@ describe('Menu', () => {
|
|||
cy.location('hash').should('equal', '#tag/pet');
|
||||
|
||||
cy.contains('[role=menuitem]', 'Find pet by ID').click({ force: true });
|
||||
cy.location('hash').should('equal', '#operation/getPetById');
|
||||
cy.location('hash').should('equal', '#tag/pet/operation/getPetById');
|
||||
});
|
||||
|
||||
it('should deactivate tag when other is activated', () => {
|
||||
|
|
|
@ -21,12 +21,12 @@ describe('Servers', () => {
|
|||
initReDoc(win, spec, {});
|
||||
|
||||
// TODO add cy-data attributes
|
||||
cy.get('[data-section-id="operation/addPet"]').should(
|
||||
cy.get('[data-section-id="tag/pet/operation/addPet"]').should(
|
||||
'contain',
|
||||
'http://petstore.swagger.io/v2/pet',
|
||||
);
|
||||
|
||||
cy.get('[data-section-id="operation/addPet"]').should(
|
||||
cy.get('[data-section-id="tag/pet/operation/addPet"]').should(
|
||||
'contain',
|
||||
'http://petstore.swagger.io/sandbox/pet',
|
||||
);
|
||||
|
@ -40,7 +40,7 @@ describe('Servers', () => {
|
|||
initReDoc(win, spec, {});
|
||||
|
||||
// TODO add cy-data attributes
|
||||
cy.get('[data-section-id="operation/addPet"]').should(
|
||||
cy.get('[data-section-id="tag/pet/operation/addPet"]').should(
|
||||
'contain',
|
||||
'http://localhost:' + win.location.port + '/pet',
|
||||
);
|
||||
|
@ -55,7 +55,7 @@ describe('Servers', () => {
|
|||
initReDoc(win, spec, {});
|
||||
|
||||
// TODO add cy-data attributes
|
||||
cy.get('[data-section-id="operation/addPet"]').should(
|
||||
cy.get('[data-section-id="tag/pet/operation/addPet"]').should(
|
||||
'contain',
|
||||
'http://localhost:' + win.location.port + '/pet',
|
||||
);
|
||||
|
|
|
@ -108,7 +108,7 @@ export class OperationModel implements IMenuItem {
|
|||
} else {
|
||||
this.id =
|
||||
operationSpec.operationId !== undefined
|
||||
? 'operation/' + operationSpec.operationId
|
||||
? (parent ? parent.id + '/' : '') + 'operation/' + operationSpec.operationId
|
||||
: parent !== undefined
|
||||
? parent.id + this.pointer
|
||||
: this.pointer;
|
||||
|
|
Loading…
Reference in New Issue
Block a user