mirror of
				https://github.com/gristlabs/grist-core.git
				synced 2025-06-13 20:53:59 +00:00 
			
		
		
		
	Add tests for autocomplete without accents
This commit is contained in:
		
							parent
							
								
									2a05d04e35
								
							
						
					
					
						commit
						0249b3d31b
					
				@ -301,6 +301,23 @@ describe('ChoiceList', function() {
 | 
			
		||||
    await gu.waitForServer();
 | 
			
		||||
    assert.equal(await driver.find('.cell_editor').isPresent(), false);
 | 
			
		||||
    assert.equal(await gu.getCell({rowNum: 1, col: 'B'}).getText(), 'Blue\nGreen\nBlack');
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
    // Starting to type names without accents should match the actual choices
 | 
			
		||||
    await gu.addColumn("Accents");
 | 
			
		||||
    await api.applyUserActions(docId, [
 | 
			
		||||
      ['ModifyColumn', 'Table1', 'Accents', {
 | 
			
		||||
        type: 'ChoiceList',
 | 
			
		||||
        widgetOptions: JSON.stringify({
 | 
			
		||||
          choices: ['Adélaïde', 'Adèle', 'Agnès', 'Amélie'],
 | 
			
		||||
        })
 | 
			
		||||
      }],
 | 
			
		||||
    ]);
 | 
			
		||||
    await gu.getCell({rowNum: 1, col: 'Accents'}).click();
 | 
			
		||||
    await driver.sendKeys('Ade', Key.ENTER);
 | 
			
		||||
    await driver.sendKeys('Agne', Key.ENTER);
 | 
			
		||||
    await driver.sendKeys('Ame', Key.ENTER);
 | 
			
		||||
    assert.deepEqual(await getEditorTokens(), ['Adélaïde', 'Agnès', 'Amélie']);
 | 
			
		||||
  });
 | 
			
		||||
 | 
			
		||||
  it('should be visible in formulas', async () => {
 | 
			
		||||
 | 
			
		||||
@ -413,6 +413,18 @@ describe('ReferenceColumns', function() {
 | 
			
		||||
        ['Dark Slate Blue', 'Dark Slate Gray', 'Slate Blue', 'Medium Slate Blue']);
 | 
			
		||||
      await driver.sendKeys(Key.ESCAPE);
 | 
			
		||||
 | 
			
		||||
      // Starting to type Añil with the accent
 | 
			
		||||
      await driver.sendKeys('añ');
 | 
			
		||||
      assert.deepEqual(await getACOptions(2),
 | 
			
		||||
        ['Añil', 'Alice Blue']);
 | 
			
		||||
      await driver.sendKeys(Key.ESCAPE);
 | 
			
		||||
 | 
			
		||||
      // Starting to type Añil without the accent should work too
 | 
			
		||||
      await driver.sendKeys('an');
 | 
			
		||||
      assert.deepEqual(await getACOptions(2),
 | 
			
		||||
        ['Añil', 'Alice Blue']);
 | 
			
		||||
      await driver.sendKeys(Key.ESCAPE);
 | 
			
		||||
 | 
			
		||||
      await driver.sendKeys('blac');
 | 
			
		||||
      assert.deepEqual(await getACOptions(6),
 | 
			
		||||
        ['Black', 'Blanched Almond', 'Blue', 'Blue Violet', 'Alice Blue', 'Cadet Blue']);
 | 
			
		||||
 | 
			
		||||
@ -709,6 +709,18 @@ describe('ReferenceList', function() {
 | 
			
		||||
        ['Dark Slate Blue', 'Dark Slate Gray', 'Slate Blue', 'Medium Slate Blue']);
 | 
			
		||||
      await driver.sendKeys(Key.ESCAPE);
 | 
			
		||||
 | 
			
		||||
      // Starting to type Añil with the accent
 | 
			
		||||
      await driver.sendKeys('añ');
 | 
			
		||||
      assert.deepEqual(await getACOptions(2),
 | 
			
		||||
        ['Añil', 'Alice Blue']);
 | 
			
		||||
      await driver.sendKeys(Key.ESCAPE);
 | 
			
		||||
 | 
			
		||||
      // Starting to type Añil without the accent should work too
 | 
			
		||||
      await driver.sendKeys('an');
 | 
			
		||||
      assert.deepEqual(await getACOptions(2),
 | 
			
		||||
        ['Añil', 'Alice Blue']);
 | 
			
		||||
      await driver.sendKeys(Key.ESCAPE);
 | 
			
		||||
 | 
			
		||||
      await driver.sendKeys('blac');
 | 
			
		||||
      assert.deepEqual(await getACOptions(6),
 | 
			
		||||
        ['Black', 'Blanched Almond', 'Blue', 'Blue Violet', 'Alice Blue', 'Cadet Blue']);
 | 
			
		||||
 | 
			
		||||
		Loading…
	
		Reference in New Issue
	
	Block a user