Skip to content

Commit

Permalink
Merge branch 'main' into get-use-counter-value
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielRyanSmith authored Jan 11, 2025
2 parents 9c2800a + 8d0493b commit c70055f
Show file tree
Hide file tree
Showing 13 changed files with 22 additions and 25 deletions.
4 changes: 2 additions & 2 deletions client-src/elements/chromedash-form-field_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ describe('chromedash-form-field', () => {
assert.include(renderElement.innerHTML, 'class="extrahelp"');
});

it('renders feature group field with a link', async () => {
it('renders Web Feature ID field with a link', async () => {
const component = await fixture(
html` <chromedash-form-field name="web_feature" value="hwb">
</chromedash-form-field>`
Expand All @@ -76,7 +76,7 @@ describe('chromedash-form-field', () => {
assert.exists(fieldRow);

const renderElement = component.renderRoot as HTMLElement;
assert.include(renderElement.innerHTML, 'Feature Group');
assert.include(renderElement.innerHTML, 'Web Feature ID');
assert.include(renderElement.innerHTML, 'input');
assert.include(renderElement.innerHTML, 'class="webdx"');
});
Expand Down
4 changes: 2 additions & 2 deletions client-src/elements/form-field-specs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -487,8 +487,8 @@ export const ALL_FIELDS: Record<string, Field> = {
type: 'datalist',
required: false,
choices: undefined, // this gets replaced in chromedash-form-field via an web features api
label: 'Feature Group',
attrs: {placeholder: 'Please select a WebDX feature group'},
label: 'Web Feature ID',
attrs: {placeholder: 'Please select a WebDX feature ID'},
help_text: html` Select the feature this belongs to. If your feature is not
listed, pick "Missing feature".`,
},
Expand Down
5 changes: 1 addition & 4 deletions internals/notifier.py
Original file line number Diff line number Diff line change
Expand Up @@ -454,10 +454,7 @@ def process_post_data(self, **kwargs):
# actually changes to it.
# Load feature directly from NDB so as to never get a stale cached copy.
fe = FeatureEntry.get_by_id(feature['id'])
user = users.User(email=triggering_user_email)
can_view_feature = permissions.can_view_feature(user, fe)

if fe and (is_update and len(changes) or not is_update) and can_view_feature:
if fe and (is_update and len(changes) or not is_update):
email_tasks = make_feature_changes_email(
fe, is_update=is_update, changes=changes,
triggering_user_email=triggering_user_email)
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 8 additions & 8 deletions packages/playwright/tests/chromedash-guide-new-page_pwtest.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import { test, expect } from '@playwright/test';
import {
captureConsoleMessages, delay, login, logout,
gotoNewFeaturePage, enterBlinkComponent, createNewFeature, enterFeatureGroup
gotoNewFeaturePage, enterBlinkComponent, createNewFeature, enterWebFeatureId
} from './test_utils';


Expand Down Expand Up @@ -101,17 +101,17 @@ test('enter blink component', async ({ page }) => {
await expect(page).toHaveScreenshot('blink-components.png');
});

test('enter feature group', async ({ page }) => {
test('enter web feature id', async ({ page }) => {
await gotoNewFeaturePage(page);

// Scroll to feature group field.
const featureGroupField = page.locator('chromedash-form-field[name=web_feature]');
await featureGroupField.scrollIntoViewIfNeeded();
await expect(featureGroupField).toBeVisible();
// Scroll to web feature id field.
const webFeatureIdField = page.locator('chromedash-form-field[name=web_feature]');
await webFeatureIdField.scrollIntoViewIfNeeded();
await expect(webFeatureIdField).toBeVisible();

await enterFeatureGroup(page);
await enterWebFeatureId(page);

await expect(page).toHaveScreenshot('feature-group.png');
await expect(page).toHaveScreenshot('feature-id.png');
});


Expand Down
18 changes: 9 additions & 9 deletions packages/playwright/tests/test_utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -310,21 +310,21 @@ export async function enterBlinkComponent(page) {
}

/**
* Enters a feature group on the page.
* Enters a web feature id on the page.
*
* @param {Page} page - The page object representing the web page.
* @return {Promise<void>} A promise that resolves once the feature group is entered.
* @return {Promise<void>} A promise that resolves once the web feature id is entered.
*/
export async function enterFeatureGroup(page) {
const featureGroupInputWrapper = page.locator('data-testid=web_feature_wrapper');
await expect(featureGroupInputWrapper).toBeVisible();
export async function enterWebFeatureId(page) {
const webFeatureIdInputWrapper = page.locator('data-testid=web_feature_wrapper');
await expect(webFeatureIdInputWrapper).toBeVisible();

// Trying to show options, doesn't work yet.
await featureGroupInputWrapper.focus();
await webFeatureIdInputWrapper.focus();
await delay(500);

const featureGroupInput = featureGroupInputWrapper.locator('input');
await featureGroupInput.fill('hwb');
const webFeatureIdInput = webFeatureIdInputWrapper.locator('input');
await webFeatureIdInput.fill('hwb');
await delay(500);

// TODO(kyleju): assert that the link to webstatus.dev is present.
Expand All @@ -350,7 +350,7 @@ export async function createNewFeature(page) {

await enterBlinkComponent(page);

await enterFeatureGroup(page);
await enterWebFeatureId(page);

// Select feature type.
const featureTypeRadioNew = page.locator('input[name="feature_type"][value="0"]');
Expand Down

0 comments on commit c70055f

Please sign in to comment.