From cdf68900d1fc4f73286f373bd38b589eee3ff6c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=BAben=20Carvalho?= Date: Fri, 24 Jan 2025 14:20:42 +0100 Subject: [PATCH] chore(theme): remove spectrum-two beta warning (#4975) --- tools/theme/src/Theme.ts | 12 ------------ tools/theme/test/theme-devmode.test.ts | 26 -------------------------- 2 files changed, 38 deletions(-) diff --git a/tools/theme/src/Theme.ts b/tools/theme/src/Theme.ts index 56efd2dbd0..dd83030d2c 100755 --- a/tools/theme/src/Theme.ts +++ b/tools/theme/src/Theme.ts @@ -87,7 +87,6 @@ export class Theme extends HTMLElement implements ThemeKindProvider { } else if (attrName === 'system') { this.system = value as SystemVariant; this._provideSystemContext(); - warnBetaSystem(this, value as SystemVariant); } else if (attrName === 'dir') { this.dir = value as 'ltr' | 'rtl' | ''; } @@ -436,17 +435,6 @@ export class Theme extends HTMLElement implements ThemeKindProvider { } } -function warnBetaSystem(instance: Theme, value: SystemVariant): void { - if (window.__swc.DEBUG && value === 'spectrum-two') { - window.__swc.warn( - instance, - 'You are currently using the beta version of the Spectrum Two system. Consumption of this system may be subject to unexpected changes before the 1.0 release of SWC.', - 'https://s2.spectrum.adobe.com/', - { level: 'high' } - ); - } -} - function checkForIssues( instance: Theme, system: SystemVariant | '', diff --git a/tools/theme/test/theme-devmode.test.ts b/tools/theme/test/theme-devmode.test.ts index 0a6ff00b24..858824671a 100644 --- a/tools/theme/test/theme-devmode.test.ts +++ b/tools/theme/test/theme-devmode.test.ts @@ -60,31 +60,5 @@ describe('Theme', () => { }, }); }); - - it('warns in Dev Mode when you use Spectrum Two theme ', async () => { - const el = await fixture(html` - - `); - - await elementUpdated(el); - - expect(consoleWarnStub.called).to.be.true; - const spyCall = consoleWarnStub.getCall(0); - expect( - (spyCall.args.at(0) as string).includes('beta version'), - 'confirm "beta-theme"-centric message' - ).to.be.true; - expect(spyCall.args.at(-1), 'confirm `data` shape').to.deep.equal({ - data: { - localName: 'sp-theme', - type: 'api', - level: 'high', - }, - }); - }); }); });