From 4cd55a287d25366cb7de0cfa559c6eea58ac9da4 Mon Sep 17 00:00:00 2001 From: fisker Cheung Date: Thu, 15 May 2025 11:35:10 +0800 Subject: [PATCH] Add a test for angular interpolation (#17433) --- .../angular/interpolation/html/17428.html | 1 + .../html/__snapshots__/format.test.js.snap | 18 ++++++++++++++++++ .../angular/interpolation/html/format.test.js | 1 + 3 files changed, 20 insertions(+) create mode 100644 tests/format/angular/interpolation/html/17428.html create mode 100644 tests/format/angular/interpolation/html/__snapshots__/format.test.js.snap create mode 100644 tests/format/angular/interpolation/html/format.test.js diff --git a/tests/format/angular/interpolation/html/17428.html b/tests/format/angular/interpolation/html/17428.html new file mode 100644 index 000000000..13d079f76 --- /dev/null +++ b/tests/format/angular/interpolation/html/17428.html @@ -0,0 +1 @@ +(there is no {{`${activityType === '' ? 'activity' : ''}${activityType === '' && costCenter === '' ? ' or ' : ''}${costCenter === '' ? 'cost center' : ''}`}}) diff --git a/tests/format/angular/interpolation/html/__snapshots__/format.test.js.snap b/tests/format/angular/interpolation/html/__snapshots__/format.test.js.snap new file mode 100644 index 000000000..e1c361775 --- /dev/null +++ b/tests/format/angular/interpolation/html/__snapshots__/format.test.js.snap @@ -0,0 +1,18 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`17428.html format 1`] = ` +====================================options===================================== +parsers: ["angular"] +printWidth: 80 + | printWidth +=====================================input====================================== +(there is no {{\`\${activityType === '' ? 'activity' : ''}\${activityType === '' && costCenter === '' ? ' or ' : ''}\${costCenter === '' ? 'cost center' : ''}\`}}) + +=====================================output===================================== +(there is no +{{ + \`\${activityType === "" ? "activity" : ""}\${activityType === "" && costCenter === "" ? " or " : ""}\${costCenter === "" ? "cost center" : ""}\` +}}) + +================================================================================ +`; diff --git a/tests/format/angular/interpolation/html/format.test.js b/tests/format/angular/interpolation/html/format.test.js new file mode 100644 index 000000000..8cbc48b1a --- /dev/null +++ b/tests/format/angular/interpolation/html/format.test.js @@ -0,0 +1 @@ +runFormatTest(import.meta, ["angular"]);