Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: broken rendering from parser upgrade #750

Merged
merged 26 commits into from
Sep 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .sonarcloud.properties
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# Disable cognitive complexity in files
sonar.exclusions=library/src/components/Schema.tsx
sonar.exclusions=library/src/components/Schema.tsx,library/src/helpers/schema.ts,library/e2e/sites/standalone-v3.html
1 change: 1 addition & 0 deletions library/e2e/integration/standalone.e2e.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
describe('Standalone bundle', () => {
testSuite('With parser', 'e2e/sites/standalone.html');
testSuite('With parser for v3', 'e2e/sites/standalone-v3.html');
testSuite('Without parser', 'e2e/sites/standalone-without-parser.html');

function testSuite(testName: string, site: string) {
Expand Down
61 changes: 61 additions & 0 deletions library/e2e/sites/standalone-v3.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
<html>
<body>
<div id="spec"></div>

<script src="../../browser/standalone/index.js"></script>
<link rel="stylesheet" href="../../styles/default.min.css" />
<script>
const schema = {
asyncapi: '3.0.0',
info: {
title: 'Example AsyncAPI',
version: '0.1.0',
},
servers: {
'example-server': {
host: 'test.example.org',
protocol: 'mqtt',
},
},
channels: {
'example-channel': {
address: 'example-channel',
messages: {
'example-message': {
payload: {
type: 'object',
properties: {
exampleField: {
type: 'string',
},
exampleNumber: {
type: 'number',
},
exampleDate: {
type: 'string',
format: 'date-time',
},
},
},
},
},
},
},
operations: {
'example-operation': {
action: 'send',
channel: {
$ref: '#/channels/example-channel',
},
reply: {
channel: {
$ref: '#/channels/example-channel',
},
},
},
},
};
AsyncApiStandalone.render({ schema }, document.getElementById('spec'));
</script>
</body>
</html>
Loading
Loading