Skip to content

Commit ebd1c5d

Browse files
Lightning00BladeDevtools-frontend LUCI CQ
authored andcommitted
[cleanup] Remove duplicate test names
We should try to avoid this, but the current EsLint rule that can do this in not very flexible. Bug: none Change-Id: I2367ad6362d91d965008046de261b38f13562f6d Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/7229102 Reviewed-by: Benedikt Meurer <[email protected]> Commit-Queue: Nikolay Vitkov <[email protected]>
1 parent 4d4076e commit ebd1c5d

File tree

9 files changed

+17
-41
lines changed

9 files changed

+17
-41
lines changed

front_end/core/sdk/CookieParser.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ describe('CookieParser', () => {
101101
sinon.assert.calledOnceWithExactly(stub, 'Failed getting cookie attribute: Discard');
102102
});
103103

104-
it('handles multiple cookies with an invalid attribute', () => {
104+
it('handles multiple cookies with an invalid attribute for max-age', () => {
105105
const stub = sinon.stub(console, 'error');
106106
parseAndExpectSetCookies(
107107
`cookie1 = value; max-age= 1440; Domain =.example.com

front_end/models/source_map_scopes/NamesResolver.test.ts

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -110,18 +110,13 @@ describeWithMockConnection('NameResolver', () => {
110110
source: 'function f(x) { let outer = x; { var b = x; return b } }',
111111
scopes: ' {B BBBBB B B B B }',
112112
},
113-
{
114-
name: 'computes identifiers with nested scopes, var lifting',
115-
source: 'function f(x) { let outer = x; { var b = x; return b } }',
116-
scopes: ' {B BBBBB B B B B }',
117-
},
118113
{
119114
name: 'computes identifiers in catch clause',
120115
source: 'function f(x) { try { } catch (e) { let a = e + x; } }',
121116
scopes: ' { <B B F > }',
122117
},
123118
{
124-
name: 'computes identifiers in catch clause',
119+
name: 'computes identifiers in catch clause with return',
125120
source: 'function f(x) { try { } catch (e) { let a = e; return a; } }',
126121
scopes: ' { < B F B > }',
127122
},

front_end/models/workspace/WorkspaceImpl.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ describe('WorkspaceImpl', () => {
109109
assert.deepEqual(result, [projectStub0]);
110110
});
111111

112-
it('can return the UI source code from project type', async () => {
112+
it('can return the UI source code', async () => {
113113
const sut = Workspace.Workspace.WorkspaceImpl.instance({forceNew: true});
114114
const uiSourceCodeStub = sinon.createStubInstance(Workspace.UISourceCode.UISourceCode);
115115
const projectStub = sinon.createStubInstance(Bindings.ContentProviderBasedProject.ContentProviderBasedProject);

front_end/panels/changes/CombinedDiffView.test.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,12 @@ describeWithEnvironment('CombinedDiffView', () => {
6969
beforeEach(() => {
7070
const workspace = createWorkspace();
7171
workspaceDiff = createWorkspaceDiff({workspace});
72-
({uiSourceCode} = createFileSystemUISourceCode(
73-
{url: URL, content: ORIGINAL_CONTENT, mimeType: 'text/javascript', fileSystemPath: 'file:///workspace'}));
72+
({uiSourceCode} = createFileSystemUISourceCode({
73+
url: URL,
74+
content: ORIGINAL_CONTENT,
75+
mimeType: 'text/javascript',
76+
fileSystemPath: 'file:///workspace',
77+
}));
7478
});
7579

7680
it('should render modified UISourceCode from a workspaceDiff on initial render', async () => {

front_end/panels/elements/StylePropertyTreeElement.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2051,7 +2051,7 @@ describeWithMockConnection('StylePropertyTreeElement', () => {
20512051
assert.strictEqual(originalText, evaluationSpy.args[0][0].textContent);
20522052
});
20532053

2054-
it('shows the original text during tracing when evaluation fails', async () => {
2054+
it('should try to resolve the values for the correct property name', async () => {
20552055
const cssModel = stylesSidebarPane.cssModel();
20562056
assert.exists(cssModel);
20572057
const resolveValuesStub = sinon.stub(cssModel, 'resolveValues').resolves([]);

front_end/panels/linear_memory_inspector/components/LinearMemoryViewer.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,7 @@ describe('LinearMemoryViewer', () => {
285285
assertSelectedCellIsHighlighted(component, VIEWER_ADDRESS_SELECTOR, 0);
286286
});
287287

288-
it('triggers an event on arrow down', async () => {
288+
it('triggers an event on arrow left', async () => {
289289
const {component, data} = await setUpComponent();
290290
const addressBefore = data.address;
291291
const expectedAddress = addressBefore - 1;
@@ -329,7 +329,7 @@ describe('LinearMemoryViewer', () => {
329329
await assertEventTriggeredOnArrowNavigation(component, 'PageDown', expectedAddress);
330330
});
331331

332-
it('triggers an event on page down', async () => {
332+
it('triggers an event on page up', async () => {
333333
const {component, data} = await setUpComponent();
334334
const addressBefore = data.address;
335335

front_end/panels/network/components/RequestHeaderSection.test.ts

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -89,29 +89,6 @@ describeWithEnvironment('RequestHeaderSection', () => {
8989
assert.isTrue(highlightedHeader?.highlight);
9090
});
9191

92-
it('highlights the requested header', async () => {
93-
const request = {
94-
cachedInMemory: () => true,
95-
cached: () => false,
96-
requestHeaders: () =>
97-
[{name: 'Ab', value: 'second'},
98-
{name: 'test', value: 'fifth'},
99-
{name: 'name', value: 'fourth'},
100-
{name: 'abc', value: 'third'},
101-
{name: 'aa', value: 'first'},
102-
],
103-
requestHeadersText: () => 'placeholderText',
104-
} as unknown as SDK.NetworkRequest.NetworkRequest;
105-
106-
const {view, widget} = await renderRequestHeaderSection(request);
107-
widget.toReveal = {section: NetworkForward.UIRequestLocation.UIHeaderSection.REQUEST, header: 'Ab'};
108-
await view.nextInput;
109-
110-
const headers = view.input.headers;
111-
const highlightedHeader = headers.find(header => header.name === 'ab');
112-
assert.isTrue(highlightedHeader?.highlight);
113-
});
114-
11592
it('correctly sets cached state', async () => {
11693
const request = {
11794
cachedInMemory: () => true,

front_end/panels/sources/BreakpointsView.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -570,21 +570,21 @@ describeWithEnvironment('BreakpointsSidebarController', () => {
570570
assert.lengthOf(actualViewData.groups[0].breakpointItems, 1);
571571
});
572572

573-
it('correctly extracts the enabled state', async () => {
573+
it('correctly extracts the enabled state for true', async () => {
574574
const {groups} =
575575
await setUpTestWithOneBreakpointLocation({file: '', lineNumber: 0, columnNumber: 0, enabled: true});
576576
const breakpointItem = groups[0].breakpointItems[0];
577577
assert.strictEqual(breakpointItem.status, Sources.BreakpointsView.BreakpointStatus.ENABLED);
578578
});
579579

580-
it('correctly extracts the enabled state', async () => {
580+
it('correctly extracts the enabled state for false', async () => {
581581
const {groups} =
582582
await setUpTestWithOneBreakpointLocation({file: '', lineNumber: 0, columnNumber: 0, enabled: false});
583583
const breakpointItem = groups[0].breakpointItems[0];
584584
assert.strictEqual(breakpointItem.status, Sources.BreakpointsView.BreakpointStatus.DISABLED);
585585
});
586586

587-
it('correctly extracts the enabled state', async () => {
587+
it('correctly extracts the enabled state for multiple', async () => {
588588
const testData = [
589589
createLocationTestData(TEST_JS_FILE, 3, 15, true /* enabled */),
590590
createLocationTestData(TEST_JS_FILE, 3, 15, false /* enabled */),

front_end/ui/legacy/ListModel.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ describe('ListModel', () => {
3333
assert.deepEqual([...model], [5, 6, 7, 1, 2, 10]);
3434
});
3535

36-
it('supports removing list elements', () => {
36+
it('supports removing list elements last', () => {
3737
const model = new UI.ListModel.ListModel([5, 6, 7, 1, 2, 10]);
3838
model.remove(model.length - 1);
3939
assert.deepEqual([...model], [5, 6, 7, 1, 2]);
@@ -45,7 +45,7 @@ describe('ListModel', () => {
4545
assert.deepEqual([...model], [5, 6, 7, 1]);
4646
});
4747

48-
it('supports replacing list elements in place', () => {
48+
it('supports inserting list elements in place', () => {
4949
const model = new UI.ListModel.ListModel([5, 6, 7, 1]);
5050
model.insert(1, 8);
5151
assert.deepEqual([...model], [5, 8, 6, 7, 1]);

0 commit comments

Comments
 (0)