Skip to content

Commit

Permalink
fixup
Browse files Browse the repository at this point in the history
  • Loading branch information
wwwillchen committed Aug 7, 2024
1 parent b616f47 commit d9e6257
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions mesop/web/src/component_renderer/component_renderer_spec.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import {checkAttributeNameIsSafe} from './component_renderer';
import {checkPropertyNameIsSafe} from './component_renderer';

describe('component renderer', () => {
describe('checkAttributeNameIsSafe', () => {
describe('checkPropertyNameIsSafe', () => {
it('should raise an exception for unsafe attribute keys', () => {
const unsafeKeys = ['src', 'SRC', 'srcdoc', 'on', 'On', 'ON', 'onClick'];
unsafeKeys.forEach((key) => {
expect(() => checkAttributeNameIsSafe(key)).toThrowError(
expect(() => checkPropertyNameIsSafe(key)).toThrowError(
`Unsafe attribute name '${key}' cannot be used.`,
);
});
Expand All @@ -14,7 +14,7 @@ describe('component renderer', () => {
it('should pass for safe attribute keys', () => {
const safeKeys = ['a', 'decrement', 'click-on'];
safeKeys.forEach((key) => {
expect(() => checkAttributeNameIsSafe(key)).not.toThrow();
expect(() => checkPropertyNameIsSafe(key)).not.toThrow();
});
});
});
Expand Down

0 comments on commit d9e6257

Please sign in to comment.