persona-community-5/.pnpm-store/v3/files/b3/d476b5417dda0db250330f6b893a6e814eceed535c6272a15a5a30a41af35295991ff39bc920689b76b18127cda096ecbc39e7dc04ad8364f50ec2899c1e56
rdev-worker a1d0d1bf1c
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
build: /implement-feature community-ui --requirements 'Build the React commu...
2026-02-24 08:22:30 +00:00

46 lines
1.3 KiB
Plaintext
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import { outdent } from 'outdent';
import { lintDocument } from '../../../lint';
import { parseYamlToDocument, replaceSourceWithRef, makeConfig } from '../../../../__tests__/utils';
import { BaseResolver } from '../../../resolve';
describe('Oas3 operation-operationId-url-safe', () => {
it('should report on invalid operationIds', async () => {
const document = parseYamlToDocument(
outdent`
openapi: 3.0.0
paths:
'/test':
get:
operationId: "valid"
put:
operationId: "invalid❤"
`,
'foobar.yaml'
);
const results = await lintDocument({
externalRefResolver: new BaseResolver(),
document,
config: await makeConfig({ rules: { 'operation-operationId-url-safe': 'error' } }),
});
expect(replaceSourceWithRef(results)).toMatchInlineSnapshot(`
[
{
"location": [
{
"pointer": "#/paths/~1test/put/operationId",
"reportOnKey": false,
"source": "foobar.yaml",
},
],
"message": "Operation \`operationId\` should not have URL invalid characters.",
"ruleId": "operation-operationId-url-safe",
"severity": "error",
"suggest": [],
},
]
`);
});
});