Skip to content

Commit

Permalink
New: Show excel icons for xlsb files
Browse files Browse the repository at this point in the history
  • Loading branch information
kritishrivastava committed Jun 11, 2019
1 parent 3a67345 commit 051ba28
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 43 deletions.
2 changes: 1 addition & 1 deletion src/lib/icons/icons.js
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ export const ICON_FILE_MAP = {};
});

// EXCEL ICON EXTENSIONS
['xls', 'xlsm', 'xlsx'].forEach((extension) => {
['xls', 'xlsm', 'xlsx', 'xlsb'].forEach((extension) => {
ICON_FILE_MAP[extension] = 'FILE_EXCEL';
});

Expand Down
59 changes: 17 additions & 42 deletions src/lib/viewers/office/__tests__/OfficeLoader-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,54 +6,29 @@ import { PERMISSION_DOWNLOAD } from '../../../constants';
const sandbox = sinon.sandbox.create();

describe('lib/viewers/office/OfficeLoader', () => {
const fakeFileTemplate = {
size: 1000,
permissions: {
can_download: true
},
representations: {
entries: [
{
representation: 'ORIGINAL'
}
]
}
};

afterEach(() => {
sandbox.verifyAndRestore();
});

describe('determineViewer()', () => {
const fakeFiles = [
{
extension: 'xlsx',
size: 1000,
permissions: {
can_download: true
},
representations: {
entries: [
{
representation: 'ORIGINAL'
}
]
}
},
{
extension: 'xlsm',
size: 1000,
permissions: {
can_download: true
},
representations: {
entries: [
{
representation: 'ORIGINAL'
}
]
}
},
{
extension: 'xlsb',
size: 1000,
permissions: {
can_download: true
},
representations: {
entries: [
{
representation: 'ORIGINAL'
}
]
}
}
Object.assign({}, fakeFileTemplate, { extension: 'xlsx' }),
Object.assign({}, fakeFileTemplate, { extension: 'xlsm' }),
Object.assign({}, fakeFileTemplate, { extension: 'xlsb' })
];

fakeFiles.forEach((fakeFile) => {
Expand Down

0 comments on commit 051ba28

Please sign in to comment.