diff --git a/package-lock.json b/package-lock.json index 2a1a644a4..80cf6883a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,7 +9,7 @@ "version": "0.0.0", "license": "MIT", "dependencies": { - "@foxy.io/sdk": "^1.16.2", + "@foxy.io/sdk": "^1.17.1", "@open-wc/lit-helpers": "^0.3.12", "@open-wc/scoped-elements": "^1.2.1", "@polymer/iron-icons": "^3.0.1", @@ -1822,9 +1822,9 @@ } }, "node_modules/@foxy.io/sdk": { - "version": "1.16.2", - "resolved": "https://registry.npmjs.org/@foxy.io/sdk/-/sdk-1.16.2.tgz", - "integrity": "sha512-jaBtjKIx3u9zzAXZ+5T52KC4rzuBMbGIcrN/ys0JGtQDjxIFV6rnnAvm56htN8N1TyF8T28TfLlNxo/VViBK+w==", + "version": "1.17.1", + "resolved": "https://registry.npmjs.org/@foxy.io/sdk/-/sdk-1.17.1.tgz", + "integrity": "sha512-7FHL934LhsZBZVngRP0bkO+iv2nmLf6+b3yuHB1vxbfj3fNdZCxkkI4MwpZg3cCMuOLGrnmDZKInONZ2mi8lew==", "license": "MIT", "dependencies": { "@types/jsdom": "^16.2.5", diff --git a/package.json b/package.json index a5658ce8c..f73432aa7 100644 --- a/package.json +++ b/package.json @@ -27,7 +27,7 @@ "prepack": "npm run lint && rimraf dist && node ./.build/compile-for-npm.js && rollup -c" }, "dependencies": { - "@foxy.io/sdk": "^1.16.2", + "@foxy.io/sdk": "^1.17.1", "@open-wc/lit-helpers": "^0.3.12", "@open-wc/scoped-elements": "^1.2.1", "@polymer/iron-icons": "^3.0.1", diff --git a/src/elements/public/StoreForm/StoreForm.test.ts b/src/elements/public/StoreForm/StoreForm.test.ts index cb009be08..9677d08e2 100644 --- a/src/elements/public/StoreForm/StoreForm.test.ts +++ b/src/elements/public/StoreForm/StoreForm.test.ts @@ -2469,4 +2469,61 @@ describe('StoreForm', () => { expect(element.errors).to.include('error:store_domain_exists'); }); + it('produces the auto-anonymize-days:v8n_too_small error when the value is under 90', () => { + const form = new Form(); + expect(form.errors).to.not.include('auto-anonymize-days:v8n_too_small'); + + form.edit({ data_retention: { auto_anonymize: false, auto_anonymize_days: 89 } }); + expect(form.errors).to.include('auto-anonymize-days:v8n_too_small'); + + form.edit({ data_retention: { auto_anonymize: false, auto_anonymize_days: 90 } }); + expect(form.errors).to.not.include('auto-anonymize-days:v8n_too_small'); + }); + + it('produces the auto-anonymize-days:v8n_required error when auto-anonymization is on but days are unset', () => { + const form = new Form(); + expect(form.errors).to.not.include('auto-anonymize-days:v8n_required'); + + form.edit({ data_retention: { auto_anonymize: true, auto_anonymize_days: null } }); + expect(form.errors).to.include('auto-anonymize-days:v8n_required'); + + form.edit({ data_retention: { auto_anonymize: true, auto_anonymize_days: 365 } }); + expect(form.errors).to.not.include('auto-anonymize-days:v8n_required'); + }); + + it('renders a switch control for auto-anonymization in the Data Retention section', async () => { + const element = await fixture