Skip to content

Commit

Permalink
fix: do not validate iframe source when defined by expressions
Browse files Browse the repository at this point in the history
Closes #974
  • Loading branch information
Skaiir committed Jan 16, 2024
1 parent d8dd39c commit 3fbbae3
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ function Url(props) {
};

const validate = (value) => {
if (!value) {
if (!value || value.startsWith('=')) {
return;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3710,6 +3710,31 @@ describe('properties panel', function() {

});


it('should NOT show error for expressions', async function() {

// given
const field = iframeSchema.components.find(({ url }) => url === 'https://bpmn.io/');

bootstrapPropertiesPanel({
container,
field
});

const feelers = findFeelers('url', container);
expect(feelers.textContent).to.equal('https://bpmn.io/');

const input = feelers.querySelector('div[contenteditable="true"]');

// when
await setEditorValue(input, '=url');

// then
const error = screen.queryByText('For security reasons the URL must start with "https".');

expect(error).not.to.exist;
});

});


Expand Down

0 comments on commit 3fbbae3

Please sign in to comment.