Skip to content

Commit

Permalink
Tab title fix
Browse files Browse the repository at this point in the history
  • Loading branch information
mgurgel committed Jan 30, 2025
1 parent ee9b38d commit abc1ba0
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 2 deletions.
4 changes: 2 additions & 2 deletions special-pages/pages/special-error/app/components/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,10 @@ function PageTitle() {
useEffect(() => {
switch (kind) {
case 'malware':
document.title = t('malwarePageHeading');
document.title = t('malwareTabTitle');
break;
case 'phishing':
document.title = t('phishingPageHeading');
document.title = t('phishingTabTitle');
break;
default:
document.title = t('sslPageHeading');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,10 @@ export class SpecialErrorPage {

async showsExpiredPage() {
const { page } = this;

const title = await page.locator('title').textContent();
expect(title).toBe('Warning: This site may be insecure');

Check failure on line 155 in special-pages/pages/special-error/integration-tests/special-error.js

View workflow job for this annotation

GitHub Actions / integration

[macos] › pages/special-error/integration-tests/special-error.spec.js:21:5 › special-error › shows SSL expired cert error

2) [macos] › pages/special-error/integration-tests/special-error.spec.js:21:5 › special-error › shows SSL expired cert error Error: expect(received).toBe(expected) // Object.is equality Expected: "Warning: This site may be insecure" Received: "Error" at pages/special-error/integration-tests/special-error.js:155 153 | 154 | const title = await page.locator('title').textContent(); > 155 | expect(title).toBe('Warning: This site may be insecure'); | ^ 156 | 157 | await expect(page.getByText('Warning: This site may be insecure', { exact: true })).toBeVisible(); 158 | await expect( at SpecialErrorPage.showsExpiredPage (/home/runner/work/content-scope-scripts/content-scope-scripts/special-pages/pages/special-error/integration-tests/special-error.js:155:23) at /home/runner/work/content-scope-scripts/content-scope-scripts/special-pages/pages/special-error/integration-tests/special-error.spec.js:24:9

await expect(page.getByText('Warning: This site may be insecure', { exact: true })).toBeVisible();
await expect(
page.getByText(
Expand All @@ -174,6 +178,10 @@ export class SpecialErrorPage {

async showsInvalidPage() {
const { page } = this;

const title = await page.locator('title').textContent();
expect(title).toBe('Warning: This site may be insecure');

Check failure on line 183 in special-pages/pages/special-error/integration-tests/special-error.js

View workflow job for this annotation

GitHub Actions / integration

[macos] › pages/special-error/integration-tests/special-error.spec.js:33:5 › special-error › shows SSL invalid cert error

3) [macos] › pages/special-error/integration-tests/special-error.spec.js:33:5 › special-error › shows SSL invalid cert error Error: expect(received).toBe(expected) // Object.is equality Expected: "Warning: This site may be insecure" Received: "Error" at pages/special-error/integration-tests/special-error.js:183 181 | 182 | const title = await page.locator('title').textContent(); > 183 | expect(title).toBe('Warning: This site may be insecure'); | ^ 184 | 185 | await expect(page.getByText('Warning: This site may be insecure', { exact: true })).toBeVisible(); 186 | await expect( at SpecialErrorPage.showsInvalidPage (/home/runner/work/content-scope-scripts/content-scope-scripts/special-pages/pages/special-error/integration-tests/special-error.js:183:23) at /home/runner/work/content-scope-scripts/content-scope-scripts/special-pages/pages/special-error/integration-tests/special-error.spec.js:36:9

await expect(page.getByText('Warning: This site may be insecure', { exact: true })).toBeVisible();
await expect(
page.getByText(
Expand All @@ -193,6 +201,10 @@ export class SpecialErrorPage {

async showsSelfSignedPage() {
const { page } = this;

const title = await page.locator('title').textContent();
expect(title).toBe('Warning: This site may be insecure');

Check failure on line 206 in special-pages/pages/special-error/integration-tests/special-error.js

View workflow job for this annotation

GitHub Actions / integration

[macos] › pages/special-error/integration-tests/special-error.spec.js:39:5 › special-error › shows SSL self signed cert error

4) [macos] › pages/special-error/integration-tests/special-error.spec.js:39:5 › special-error › shows SSL self signed cert error Error: expect(received).toBe(expected) // Object.is equality Expected: "Warning: This site may be insecure" Received: "Error" at pages/special-error/integration-tests/special-error.js:206 204 | 205 | const title = await page.locator('title').textContent(); > 206 | expect(title).toBe('Warning: This site may be insecure'); | ^ 207 | 208 | await expect(page.getByText('Warning: This site may be insecure', { exact: true })).toBeVisible(); 209 | await expect( at SpecialErrorPage.showsSelfSignedPage (/home/runner/work/content-scope-scripts/content-scope-scripts/special-pages/pages/special-error/integration-tests/special-error.js:206:23) at /home/runner/work/content-scope-scripts/content-scope-scripts/special-pages/pages/special-error/integration-tests/special-error.spec.js:42:9

await expect(page.getByText('Warning: This site may be insecure', { exact: true })).toBeVisible();
await expect(
page.getByText(
Expand All @@ -212,6 +224,10 @@ export class SpecialErrorPage {

async showsWrongHostPage() {
const { page } = this;

const title = await page.locator('title').textContent();
expect(title).toBe('Warning: This site may be insecure');

Check failure on line 229 in special-pages/pages/special-error/integration-tests/special-error.js

View workflow job for this annotation

GitHub Actions / integration

[macos] › pages/special-error/integration-tests/special-error.spec.js:45:5 › special-error › shows SSL wrong host error

5) [macos] › pages/special-error/integration-tests/special-error.spec.js:45:5 › special-error › shows SSL wrong host error Error: expect(received).toBe(expected) // Object.is equality Expected: "Warning: This site may be insecure" Received: "Error" at pages/special-error/integration-tests/special-error.js:229 227 | 228 | const title = await page.locator('title').textContent(); > 229 | expect(title).toBe('Warning: This site may be insecure'); | ^ 230 | 231 | await expect(page.getByText('Warning: This site may be insecure', { exact: true })).toBeVisible(); 232 | await expect( at SpecialErrorPage.showsWrongHostPage (/home/runner/work/content-scope-scripts/content-scope-scripts/special-pages/pages/special-error/integration-tests/special-error.js:229:23) at /home/runner/work/content-scope-scripts/content-scope-scripts/special-pages/pages/special-error/integration-tests/special-error.spec.js:48:9

await expect(page.getByText('Warning: This site may be insecure', { exact: true })).toBeVisible();
await expect(
page.getByText(
Expand All @@ -231,6 +247,10 @@ export class SpecialErrorPage {

async showsPhishingPage() {
const { page } = this;

const title = await page.locator('title').textContent();
expect(title).toBe('Warning: Security Risk');

Check failure on line 252 in special-pages/pages/special-error/integration-tests/special-error.js

View workflow job for this annotation

GitHub Actions / integration

[macos] › pages/special-error/integration-tests/special-error.spec.js:51:5 › special-error › shows phishing warning

6) [macos] › pages/special-error/integration-tests/special-error.spec.js:51:5 › special-error › shows phishing warning Error: expect(received).toBe(expected) // Object.is equality Expected: "Warning: Security Risk" Received: "Error" at pages/special-error/integration-tests/special-error.js:252 250 | 251 | const title = await page.locator('title').textContent(); > 252 | expect(title).toBe('Warning: Security Risk'); | ^ 253 | 254 | await expect(page.getByText('Warning: This site may be a security risk', { exact: true })).toBeVisible(); 255 | await expect( at SpecialErrorPage.showsPhishingPage (/home/runner/work/content-scope-scripts/content-scope-scripts/special-pages/pages/special-error/integration-tests/special-error.js:252:23) at /home/runner/work/content-scope-scripts/content-scope-scripts/special-pages/pages/special-error/integration-tests/special-error.spec.js:54:9

await expect(page.getByText('Warning: This site may be a security risk', { exact: true })).toBeVisible();
await expect(
page.getByText(
Expand All @@ -249,6 +269,10 @@ export class SpecialErrorPage {

async showsMalwarePage() {
const { page } = this;

const title = await page.locator('title').textContent();
expect(title).toBe('Warning: Security Risk');

Check failure on line 274 in special-pages/pages/special-error/integration-tests/special-error.js

View workflow job for this annotation

GitHub Actions / integration

[macos] › pages/special-error/integration-tests/special-error.spec.js:57:5 › special-error › shows malware warning

7) [macos] › pages/special-error/integration-tests/special-error.spec.js:57:5 › special-error › shows malware warning Error: expect(received).toBe(expected) // Object.is equality Expected: "Warning: Security Risk" Received: "Error" at pages/special-error/integration-tests/special-error.js:274 272 | 273 | const title = await page.locator('title').textContent(); > 274 | expect(title).toBe('Warning: Security Risk'); | ^ 275 | 276 | await expect(page.getByText('Warning: This site may be a security risk', { exact: true })).toBeVisible(); 277 | await expect( at SpecialErrorPage.showsMalwarePage (/home/runner/work/content-scope-scripts/content-scope-scripts/special-pages/pages/special-error/integration-tests/special-error.js:274:23) at /home/runner/work/content-scope-scripts/content-scope-scripts/special-pages/pages/special-error/integration-tests/special-error.spec.js:60:9

await expect(page.getByText('Warning: This site may be a security risk', { exact: true })).toBeVisible();
await expect(
page.getByText(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@
"title": "Warning: This site may be a security risk",
"note": "Title shown in an error page that warn users of security risks on a website due to malware distribution"
},
"malwareTabTitle": {
"title": "Warning: Security Risk",
"note": "Title shown in the browser window or tab when the current page may be a security risk due to malware"
},
"malwareWarningText": {
"title": "DuckDuckGo blocked this page because it may be distributing malware designed to compromise your device or steal your personal information. <a>Learn more</a>",
"note": "Error description shown in an error page that warns users of security risks on a website due to malware distribution."
Expand All @@ -41,6 +45,10 @@
"title": "Warning: This site may be a security risk",
"note": "Title shown in an error page that warn users of security risks on a website due to Phishing issues"
},
"phishingTabTitle": {
"title": "Warning: Security Risk",
"note": "Title shown in the browser window or tab when the current page may be a security risk due to phishing"
},
"phishingWarningText": {
"title": "This website may be impersonating a legitimate site in order to trick you into providing personal information, such as passwords or credit card numbers. <a>Learn more</a>",
"note": "Error description shown in an error page that warns users of security risks on a website due to Phishing issues."
Expand Down

0 comments on commit abc1ba0

Please sign in to comment.