title: Alphabetical sorting by name - javascipt, cypress
body: <p>I need help with this code</p>
  <pre><code>/// &lt;reference types=&quot;cypress&quot; /&gt;
  import { get } from 'lodash';
   
   
  const jsQuery = require('json-query');
  const utils = require('../../../support/utils')
  const roles = utils.roles;
  const uri = Cypress.env('res_URL')
  const AUT = roles.Admin;
  const LONG_TIMEOUT = 10 * 1000;
   
  describe('Alphabetical name sorting', () =&gt; {
   
      before(function () {
          //Log in 
          cy.login_Res(AUT.username, AUT.password)
      })
   
   
   
      it(&quot;sorting test&quot;, () =&gt; {
          cy.visit(`${Cypress.env('res_URL')}/testpage`);
   
          const checkAscSort = (value, limit) =&gt; {
              const recordsUiAsc = cy.get('#Cust').children().map(function(){ return this.label;});
              //const ascSorted = [];
   
              cy.get(value).then(rows =&gt; {
                 const end = limit || rows.length;`enter code here`
                  for (let i = 1; i &lt; end; i++) {
                      const text = rows[i].innerText.toLowerCase();
   
                      recordsUiAsc.push(text);
                      ascSorted.push(text);
                  }
                           const sortArray = recordsUiAsc.sort();
              expect(recordsUiAsc).to.equal(sortArray);
   
   
              });
          }
      });
   
  }) //End of Spec
  </code></pre>
  <p>this is array cy.get('#Cust').children().map(function(){ return this.label;});
  that returns all names and surnames for #Cust
  but when run cypress it does not show that expect was run</p>