Skip to content

Commit

Permalink
fix(test): use valid bindingVersion in Operations test in case `s…
Browse files Browse the repository at this point in the history
…hould render bindings for operation`
  • Loading branch information
korifey91 committed Apr 11, 2024
1 parent 24182cd commit 0839c64
Showing 1 changed file with 20 additions and 20 deletions.
40 changes: 20 additions & 20 deletions test/components/Operations.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,11 +100,11 @@ A longer description of the message
}
\`\`\`
`;

const result = render(<Operations asyncapi={asyncapi} />);
expect(result.trim()).toEqual(expected.trim());
});

it('should render servers for operation', () => {
const asyncapi = createAsyncAPIDocument({
semver: {
Expand Down Expand Up @@ -199,11 +199,11 @@ A longer description of the message
}
\`\`\`
`;

const result = render(<Operations asyncapi={asyncapi} />);
expect(result.trim()).toEqual(expected.trim());
});

it('should render parameters for operation', () => {
const asyncapi = new AsyncAPIDocument({
asyncapi: '2.0.0',
Expand Down Expand Up @@ -239,11 +239,11 @@ A longer description of the message
| userId | string | Id of the user. | - | - | **required**, **parameter location ($message.payload#/user/id)** |
| foobar | string | - | - | - | **required** |
`;

const result = render(<Operations asyncapi={asyncapi} />);
expect(result.trim()).toEqual(expected.trim());
});

it('should render multiple messages', () => {
const asyncapi = new AsyncAPIDocument({
asyncapi: '2.0.0',
Expand Down Expand Up @@ -328,11 +328,11 @@ A longer description of the message
}
\`\`\`
`;

const result = render(<Operations asyncapi={asyncapi} />);
expect(result.trim()).toEqual(expected.trim());
});

it('should render security', () => {
const asyncapi = createAsyncAPIDocument({
semver: {
Expand Down Expand Up @@ -399,11 +399,11 @@ A longer description of the message
The oauth security descriptions
`;

const result = render(<Operations asyncapi={asyncapi} />);
expect(result.trim()).toEqual(expected.trim());
});

it('should render bindings', () => {
const asyncapi = new AsyncAPIDocument({
asyncapi: '2.0.0',
Expand Down Expand Up @@ -475,11 +475,11 @@ A longer description of the message
| clientId | string | - | allowed (\`"myClientId"\`) | - | - |
| bindingVersion | - | - | \`"0.1.0"\` | - | - |
`;

const result = render(<Operations asyncapi={asyncapi} />);
expect(result.trim()).toEqual(expected.trim());
});

it('should render extensions', () => {
const asyncapi = new AsyncAPIDocument({
asyncapi: '2.0.0',
Expand Down Expand Up @@ -553,14 +553,14 @@ A longer description of the message
| x-schema-extensions-as-array.0 (index) | - | - | \`"item1"\` | - | - |
| x-schema-extensions-as-array.1 (index) | - | - | \`"item2"\` | - | - |
`;

const result = render(<Operations asyncapi={asyncapi} />);
expect(result.trim()).toEqual(expected.trim());
});

it('should render nothing if channels with operations are not defined', () => {
const asyncapi = new AsyncAPIDocument({});

const result = render(<Operations asyncapi={asyncapi} />);
expect(result).toEqual('');
});
Expand Down Expand Up @@ -625,7 +625,7 @@ A longer description of the message
}
}
});

expect(diagnostics).toEqual([]);
const result = render(<Operations asyncapi={document} />);
expect(result.trim()).toMatchSnapshot();
Expand Down Expand Up @@ -689,7 +689,7 @@ A longer description of the message
}
}
});

expect(diagnostics).toEqual([]);
const result = render(<Operations asyncapi={document} />);
expect(result.trim()).toMatchSnapshot();
Expand Down Expand Up @@ -778,7 +778,7 @@ A longer description of the message
}
}
});

expect(diagnostics).toEqual([]);
const result = render(<Operations asyncapi={document} />);
expect(result.trim()).toMatchSnapshot();
Expand Down Expand Up @@ -867,7 +867,7 @@ A longer description of the message
}
}
});

expect(diagnostics).toEqual([]);
const result = render(<Operations asyncapi={document} />);
expect(result.trim()).toMatchSnapshot();
Expand Down Expand Up @@ -1111,7 +1111,7 @@ A longer description of the message
'myClientId'
]
},
bindingVersion: '0.1.0'
bindingVersion: '0.4.0'
}
},
}
Expand Down

0 comments on commit 0839c64

Please sign in to comment.