Commit dfd1b1a2 authored by catch's avatar catch
Browse files

Issue #3222107 by codebymikey, bnjmnm, chandu7929, Spokje, vipin.mittal18,...

Issue #3222107 by codebymikey, bnjmnm, chandu7929, Spokje, vipin.mittal18, jmickela, Shubham Chandra, trickfun, catch, larowlan: [needs backport] Library order asset weights do not work properly when a large number of javascript files is loaded between two jQuery UI libraries
parent 8914d3ea
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -30,7 +30,9 @@ public function testLoadOrder() {
    $this->drupalGet('many_assets_test');

    $js = $this->getSession()->getPage()->findAll('css', 'script[data-weight]');
    $js_files = array_map(fn ($item) => $item->getAttribute('data-weight'), $js);
    $js_files = array_map(function ($item) {
      return $item->getAttribute('data-weight');
    }, $js);
    $this->assertGreaterThan(0, count($js_files));
    $js_files_sorted = $js_files;
    asort($js_files_sorted);
@@ -40,7 +42,9 @@ public function testLoadOrder() {
    $this->assertSame($js_files_sorted, $js_files);

    $css = $this->getSession()->getPage()->findAll('css', 'link[data-weight]');
    $css_files = array_map(fn($item) => $item->getAttribute('data-weight'), $css);
    $css_files = array_map(function ($item) {
      return $item->getAttribute('data-weight');
    }, $css);
    $this->assertGreaterThan(0, count($css_files));
    $css_files_sorted = $css_files;
    asort($css_files_sorted);