Skip to content

Commit

Permalink
test(api-doc): update markdown test
Browse files Browse the repository at this point in the history
  • Loading branch information
HenriPro committed Sep 11, 2024
1 parent bc5fe0e commit e56fe64
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 9 deletions.
22 changes: 15 additions & 7 deletions cypress/e2e/specs/api_documentation.spec.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,24 @@
import { product, productVersion } from '../fixtures/consts'
import childrenApiDocumentationJSON from '../fixtures/dochub_mocks/childrenApiDocumentation.json'
import documentTreeJSON from '../fixtures/dochub_mocks/documentTree.json'

import { FeatureFlags } from '@/constants/feature-flags'
describe('Api Documentation Page', () => {
beforeEach(() => {
product.document_count = 1
cy.mockPrivatePortal()
cy.mockProduct(product.id, product)
cy.mockGetProductDocumentBySlug(product.id, 'bar')
cy.mockGetProductDocuments(product.id)
cy.mockProductOperations()
cy.mockStylesheetFont()

cy.mockLaunchDarklyFlags([
{
name: FeatureFlags.newMarkdownRender,
value: false
}
]).then(() => {
cy.mockPrivatePortal()
cy.mockProduct(product.id, product)
cy.mockGetProductDocumentBySlug(product.id, 'bar')
cy.mockGetProductDocuments(product.id)
cy.mockProductOperations()
cy.mockStylesheetFont()
})
})

const PARENT_DOCUMENT_URL = `/docs/${product.id}/${documentTreeJSON[0].slug}`
Expand Down
6 changes: 4 additions & 2 deletions src/views/ApiDocumentationPage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
<MarkdownUi
v-else-if="markdown && newMarkdownRenderEnabled"
v-model="markdown"
class="documentation-display"
class="documentation-display portal-document-viewer"
theme="light"
/>
</template>
Expand Down Expand Up @@ -77,7 +77,8 @@ import ErrorWrapper from '@/components/ErrorWrapper.vue'
import { findAllNodesOfType, getNodeTextContent } from '@/helpers/document'
import { ProductWithVersions, useI18nStore, useProductStore } from '@/stores'
import useToaster from '@/composables/useToaster'
import { HeadingNode, addSlug } from '@kong-ui-public/document-viewer'
import DocumentViewer, { HeadingNode, addSlug } from '@kong-ui-public/document-viewer'
import '@kong-ui-public/document-viewer/dist/style.css'
import { MarkdownUi } from '@kong/markdown'
import '@kong/markdown/dist/style.css'
import { DocumentBlock, ProductDocument } from '@kong/sdk-portal-js'
Expand All @@ -88,6 +89,7 @@ export default defineComponent({
name: 'ApiDocumentationPage',
components: {
MarkdownUi,
DocumentViewer,
DocumentSections,
ErrorWrapper
},
Expand Down

0 comments on commit e56fe64

Please sign in to comment.