Skip to content

Commit

Permalink
fix: the value in the component is incorrectly updated when it is pas…
Browse files Browse the repository at this point in the history
…sed as an empty string using formControl
  • Loading branch information
splincode committed Nov 12, 2024
1 parent ce1af38 commit 8d4b583
Show file tree
Hide file tree
Showing 14 changed files with 246 additions and 31 deletions.
2 changes: 1 addition & 1 deletion .cspell.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"$schema": "https://raw.githubusercontent.com/streetsidesoftware/cspell/master/cspell.schema.json",
"import": ["@taiga-ui/cspell-config/cspell.config.js"],
"ignoreWords": ["todoify", "Lyyy", "Textblock", "hardbreak", "softbreak", "inlines"],
"ignoreWords": ["todoify", "Lyyy", "Textblock", "hardbreak", "softbreak", "inlines", "estruyf"],
"files": ["*/*.*"]
}
1 change: 1 addition & 0 deletions .github/workflows/deploy-preview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ jobs:
repoToken: ${{ secrets.GITHUB_TOKEN }}
firebaseServiceAccount: ${{ secrets.FIREBASE_SERVICE_ACCOUNT_TUI_EDITOR }}
projectId: taiga-editor
target: demo
expires: 1d

concurrency:
Expand Down
11 changes: 11 additions & 0 deletions .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,17 @@ jobs:
compression-level: 0
retention-days: 1

- name: Deploy report
uses: FirebaseExtended/action-hosting-deploy@v0
continue-on-error: true
if: ${{ env.IS_FORK == 'false' && env.IS_DEPENDABOT == 'false' }}
with:
repoToken: ${{ secrets.GITHUB_TOKEN }}
firebaseServiceAccount: ${{ secrets.FIREBASE_SERVICE_ACCOUNT_TUI_EDITOR }}
projectId: taiga-editor
target: e2e-report
expires: 1d

- id: diff-checker
run: |
echo "diff_exist=$(find ./projects/demo-playwright/tests-results -regex '.*diff\.png$' | wc -l | sed -e 's/^[[:space:]]*//')" >> $GITHUB_OUTPUT
Expand Down
34 changes: 24 additions & 10 deletions firebase.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,26 @@
{
"hosting": {
"public": "dist/demo/browser",
"ignore": ["firebase.json", "**/.*", "**/node_modules/**"],
"rewrites": [
{
"source": "**",
"destination": "/index.html"
}
]
}
"hosting": [
{
"target": "demo",
"public": "dist/demo/browser",
"ignore": ["firebase.json", "**/.*", "**/node_modules/**"],
"rewrites": [
{
"source": "**",
"destination": "/index.html"
}
]
},
{
"target": "e2e-report",
"public": "projects/demo-playwright/tests-report",
"ignore": ["firebase.json", "**/.*", "**/node_modules/**"],
"rewrites": [
{
"source": "**",
"destination": "/index.html"
}
]
}
]
}
131 changes: 131 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"prepare": "husky",
"start": "nx serve editor-demo",
"lint": "eslint .",
"cspell": "cspell --relative --dot --gitignore .",
"cspell": "cspell --relative --dot --no-progress --gitignore .",
"prettier": "prettier !package-lock.json !taiga-ui/** . --ignore-path .gitignore",
"stylelint": "stylelint './projects/**/*.{less,css}' --config package.json",
"release": "npx syncer && npx nx publish editor"
Expand Down Expand Up @@ -80,6 +80,7 @@
"@angular/platform-browser-dynamic": "16.2.12",
"@angular/platform-server": "16.2.12",
"@angular/router": "16.2.12",
"@estruyf/github-actions-reporter": "1.9.2",
"@ng-web-apis/common": "4.11.1",
"@ng-web-apis/universal": "4.11.1",
"@nguniversal/builders": "16.2.0",
Expand Down
14 changes: 13 additions & 1 deletion projects/demo-playwright/playwright.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,19 @@ export default defineConfig({
testMatch: '**/*.spec.ts',
outputDir: 'tests-results',
snapshotDir: 'snapshots',
reporter: process.env.CI ? 'github' : [['html', {outputFolder: 'tests-report'}]],
reporter: process.env.CI
? [
['html', {outputFolder: 'tests-report'}],
[
'@estruyf/github-actions-reporter',
{
title: 'My custom title',
useDetails: true,
showError: true,
},
],
]
: [['html', {outputFolder: 'tests-report'}]],
fullyParallel: true,
/* Fail the build on CI if you accidentally left test.only in the source code. */
forbidOnly: !!process.env.CI,
Expand Down
2 changes: 1 addition & 1 deletion projects/demo-playwright/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"e2e-ui": {
"executor": "nx:run-commands",
"options": {
"command": "nx e2e editor-demo-playwright -- --ui --debug --update-snapshots"
"command": "nx e2e editor-demo-playwright --ui --debug --update-snapshots"
}
}
}
Expand Down
23 changes: 23 additions & 0 deletions projects/demo-playwright/tests/reset.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import {expect, test} from '@playwright/test';

import {tuiGoto} from '../utils';

test.describe('Reset', () => {
test('Correct reset value from wysiwyg', async ({page}) => {
await tuiGoto(page, '/starter-kit?placeholder=Hello');

await expect(page.locator('tui-editor')).toHaveScreenshot('Reset-01.png');

await page.locator('button:has-text("Reset")').click();

await expect(page.locator('tui-editor')).toHaveScreenshot('Reset-02.png');

await page.locator('tui-editor [contenteditable]').fill('12345');

await expect(page.locator('tui-editor')).toHaveScreenshot('Reset-03.png');

await page.locator('button:has-text("Reset")').click();

await expect(page.locator('tui-editor')).toHaveScreenshot('Reset-04.png');
});
});
Loading

0 comments on commit 8d4b583

Please sign in to comment.