Skip to content

Commit

Permalink
Missing changes #7031
Browse files Browse the repository at this point in the history
  • Loading branch information
wszymanski committed Jul 23, 2020
1 parent b9fbc01 commit 64024c3
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/dataSource.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ class DataSource {
/**
* Returns array of column values from the data source. `column` is the index of the row in the data source.
*
* @param {string|number} column Column property which may be also a physical column index.
* @param {number} column Visual column index.
* @returns {Array}
*/
getAtColumn(column) {
Expand Down
14 changes: 14 additions & 0 deletions test/e2e/core/colToProp.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,20 @@ describe('Core.colToProp', () => {
expect(colToProp(2)).toBe('lastName');
});

it('it should return the provided property name, when the user passes a property name as a column number', () => {
handsontable({
data: [{
id: 1,
sort: true,
length: 2
}]
});

expect(colToProp('id')).toBe('id');
expect(colToProp('sort')).toBe('sort');
expect(colToProp('length')).toBe('length');
});

it('should return proper value after calling the function when columns was reorganized (data is array of arrays)', () => {
const hot = handsontable({
data: Handsontable.helper.createSpreadsheetData(5, 5)
Expand Down

0 comments on commit 64024c3

Please sign in to comment.