Skip to content

Commit

Permalink
[NTP][Quests] Cleanup quests tests
Browse files Browse the repository at this point in the history
Cleanup the tests for quests:
* Split the testing of elements into separate files to make it simpler
  when image tests are added and to simplify tests that do not need the
  entire module.
* Add an initializeModule function to hold the code that creates the
  element, sets its data, and adds it to the DOM so it doesn't have to
  be repeated in every test.
* Let layoutType and num of related searches be passed into the function
  for creating a sample cluster since it was having to be added to
  overrides in basically every test. Otherwise, we were creating the
  URLVisits twice.

Bug: 1424951
Change-Id: I023448ad57e81e640196aacb8620694aa9795395
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4342604
Reviewed-by: Marlon Facey <mfacey@google.com>
Reviewed-by: Roman Arora <romanarora@chromium.org>
Commit-Queue: Riley Tatum <rtatum@google.com>
Cr-Commit-Position: refs/heads/main@{#1118414}
  • Loading branch information
Riley Tatum authored and Chromium LUCI CQ committed Mar 16, 2023
1 parent 1e03fb0 commit 457bba2
Show file tree
Hide file tree
Showing 7 changed files with 237 additions and 249 deletions.
2 changes: 2 additions & 0 deletions chrome/browser/resources/new_tab_page/lazy_load.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ export {FeedProxy} from './modules/feed/feed_module_proxy.js';
export {feedDescriptor, FeedModuleElement, feedV2Descriptor} from './modules/feed/module.js';
export {HistoryClustersProxy, HistoryClustersProxyImpl} from './modules/history_clusters/history_clusters_proxy.js';
export {HistoryClusterLayoutType, historyClustersDescriptor, HistoryClustersModuleElement, LAYOUT_1_MIN_IMAGE_VISITS, LAYOUT_1_MIN_VISITS, LAYOUT_2_MIN_IMAGE_VISITS, LAYOUT_2_MIN_VISITS, LAYOUT_3_MIN_IMAGE_VISITS, LAYOUT_3_MIN_VISITS, MIN_RELATED_SEARCHES} from './modules/history_clusters/module.js';
export {SuggestTileModuleElement} from './modules/history_clusters/suggest_tile.js';
export {TileModuleElement} from './modules/history_clusters/tile.js';
export {InfoDialogElement} from './modules/info_dialog.js';
export {InitializeModuleCallback, Module, ModuleDescriptor, ModuleDescriptorV2, ModuleHeight} from './modules/module_descriptor.js';
export {counterfactualLoad} from './modules/module_descriptors.js';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,9 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

history_clusters_test_files = [ "modules/history_clusters/module_test.ts" ]
history_clusters_test_files = [
"modules/history_clusters/module_test.ts",
"modules/history_clusters/suggest_tile_test.ts",
"modules/history_clusters/test_support.ts",
"modules/history_clusters/tile_test.ts",
]

0 comments on commit 457bba2

Please sign in to comment.