Skip to content

Commit

Permalink
Merge pull request #282 from infor-design/fix-tests-locale
Browse files Browse the repository at this point in the history
Chore: Add test fixes for locale
  • Loading branch information
tmcconechy committed Aug 3, 2021
2 parents f785b64 + 31fe571 commit e8f6744
Show file tree
Hide file tree
Showing 3 changed files with 76 additions and 105 deletions.
10 changes: 4 additions & 6 deletions test/ids-data-grid/ids-data-grid-func-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -174,10 +174,6 @@ describe('IdsDataGrid Component', () => {
expect(dataGrid.getAttribute('label')).toEqual(null);
});

it('renders correctly', () => {
expect(dataGrid.shadowRoot.innerHTML).toMatchSnapshot();
});

it('renders column css with adoptedStyleSheets', () => {
document.body.innerHTML = '';
dataGrid = new IdsDataGrid();
Expand Down Expand Up @@ -471,10 +467,12 @@ describe('IdsDataGrid Component', () => {

it('can render with the time formatter', () => {
expect(dataGrid.shadowRoot.querySelectorAll('.ids-data-grid-row')[1]
.querySelectorAll('.ids-data-grid-cell')[5].querySelector('.text-ellipsis').innerHTML).toEqual('2:25 PM');
.querySelectorAll('.ids-data-grid-cell')[5].querySelector('.text-ellipsis').innerHTML)
.toEqual(new Intl.DateTimeFormat('en-US', { hour: 'numeric', minute: 'numeric' }).format(new Date('2021-04-23T18:25:43.511Z')));

expect(dataGrid.shadowRoot.querySelectorAll('.ids-data-grid-row')[4]
.querySelectorAll('.ids-data-grid-cell')[5].querySelector('.text-ellipsis').innerHTML).toEqual('');
.querySelectorAll('.ids-data-grid-cell')[5].querySelector('.text-ellipsis').innerHTML)
.toEqual('');
});

it('can render with the decimal formatter', () => {
Expand Down
Loading

0 comments on commit e8f6744

Please sign in to comment.