Skip to content

Commit

Permalink
chore: added tests for read only property
Browse files Browse the repository at this point in the history
Related to #1063
  • Loading branch information
Skaiir committed Feb 22, 2024
1 parent e1def6b commit 6738227
Showing 1 changed file with 49 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,8 @@ describe('properties panel', function() {
'Field description',
'Key',
'Default value',
'Disabled'
'Disabled',
'Read only'
]);

expectGroupEntries(container, 'Validation', [
Expand Down Expand Up @@ -433,7 +434,8 @@ describe('properties panel', function() {
'Field description',
'Key',
'Default value',
'Disabled'
'Disabled',
'Read only'
]);

expectGroupEntries(container, 'Options source', [
Expand Down Expand Up @@ -929,7 +931,8 @@ describe('properties panel', function() {
'Field label',
'Field description',
'Key',
'Disabled'
'Disabled',
'Read only'
]);

expectGroupEntries(container, 'Options source', [
Expand Down Expand Up @@ -976,7 +979,8 @@ describe('properties panel', function() {
'Field label',
'Field description',
'Key',
'Disabled'
'Disabled',
'Read only'
]);

expectGroupEntries(container, 'Options source', [
Expand Down Expand Up @@ -1204,7 +1208,8 @@ describe('properties panel', function() {
'Field label',
'Field description',
'Key',
'Disabled'
'Disabled',
'Read only'
]);

expectGroupEntries(container, 'Options source', [
Expand Down Expand Up @@ -1247,7 +1252,8 @@ describe('properties panel', function() {
'Field label',
'Field description',
'Key',
'Disabled'
'Disabled',
'Read only'
]);

expectGroupEntries(container, 'Options source', [
Expand Down Expand Up @@ -1513,7 +1519,8 @@ describe('properties panel', function() {
'Field label',
'Field description',
'Key',
'Disabled'
'Disabled',
'Read only'
]);

expectGroupEntries(container, 'Options source', [
Expand Down Expand Up @@ -1655,7 +1662,8 @@ describe('properties panel', function() {
'Field label',
'Field description',
'Key',
'Disabled'
'Disabled',
'Read only'
]);

expectGroupEntries(container, 'Options source', [
Expand Down Expand Up @@ -1705,7 +1713,8 @@ describe('properties panel', function() {
'Key',
'Subtype',
'Use 24h',
'Disabled'
'Disabled',
'Read only'
]);

expectGroupEntries(container, 'Serialization', [
Expand Down Expand Up @@ -1753,7 +1762,8 @@ describe('properties panel', function() {
'Key',
'Default value',
'Searchable',
'Disabled'
'Disabled',
'Read only'
]);

expectGroupEntries(container, 'Options source', [
Expand Down Expand Up @@ -2176,7 +2186,8 @@ describe('properties panel', function() {
'Field label',
'Field description',
'Key',
'Disabled'
'Disabled',
'Read only'
]);

expectGroupEntries(container, 'Options source', [
Expand Down Expand Up @@ -2319,7 +2330,8 @@ describe('properties panel', function() {
'Field label',
'Field description',
'Key',
'Disabled'
'Disabled',
'Read only'
]);

expectGroupEntries(container, 'Options source', [
Expand Down Expand Up @@ -2513,7 +2525,8 @@ describe('properties panel', function() {
'Field description',
'Key',
'Default value',
'Disabled'
'Disabled',
'Read only'
]);

expectGroupEntries(container, 'Validation', [
Expand Down Expand Up @@ -2821,7 +2834,8 @@ describe('properties panel', function() {
'Default value',
'Decimal digits',
'Increment',
'Disabled'
'Disabled',
'Read only'
]);

expectGroupEntries(container, 'Serialization', [
Expand Down Expand Up @@ -3006,7 +3020,6 @@ describe('properties panel', function() {

});


describe('validation', function() {

describe('default value', function() {
Expand Down Expand Up @@ -3455,6 +3468,27 @@ describe('properties panel', function() {

});

describe('read only', function() {

it('should not render when disabled', function() {

// given
const field = schema.components.find(({ key }) => key === 'amount');
field.disabled = true;

bootstrapPropertiesPanel({
container,
field
});

// then
const readOnlyElement = screen.queryByLabelText('Read only');
expect(readOnlyElement).to.not.exist;

});

});

});


Expand Down

0 comments on commit 6738227

Please sign in to comment.