-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(corner-toolbar): set default value for locale option
- Loading branch information
1 parent
de1d016
commit b4b87e9
Showing
4 changed files
with
79 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
import { click } from '../utils'; | ||
import { query } from '../../src/utils'; | ||
import { CornerToolbar } from '../../src/ui/corner-toolbar'; | ||
import { Nodes, icons } from '../../src'; | ||
|
||
describe('ui / corner-toolbar-ui', () => { | ||
|
||
let rootNode: Nodes; | ||
|
||
before(()=> { | ||
rootNode = query('<div class="lake-corner-toolbar-root" style="position:relative;" />'); | ||
query(document.body).append(rootNode); | ||
}); | ||
|
||
it('corner toolbar', () => { | ||
let buttonValue; | ||
const cornerToolbar = new CornerToolbar({ | ||
root: rootNode, | ||
items: [ | ||
{ | ||
name: 'view', | ||
icon: icons.get('maximize'), | ||
tooltip: 'Full screen', | ||
onClick: () => { | ||
buttonValue = 'view clicked'; | ||
}, | ||
}, | ||
{ | ||
name: 'remove', | ||
icon: icons.get('remove'), | ||
tooltip: 'Remove', | ||
onClick: () => { | ||
buttonValue = 'remove clicked'; | ||
}, | ||
}, | ||
], | ||
}); | ||
cornerToolbar.render(); | ||
cornerToolbar.container.show(); | ||
click(cornerToolbar.container.find('button[name="remove"]')); | ||
expect(buttonValue).to.equal('remove clicked'); | ||
}); | ||
|
||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import { query } from '../../src/utils'; | ||
import { CornerToolbar } from '../../src/ui/corner-toolbar'; | ||
import { Nodes } from '../../src'; | ||
|
||
describe('ui / corner-toolbar', () => { | ||
|
||
let rootNode: Nodes; | ||
|
||
beforeEach(()=> { | ||
rootNode = query('<div class="lake-corner-toolbar-root" style="position:relative;" />'); | ||
query(document.body).append(rootNode); | ||
}); | ||
|
||
afterEach(() => { | ||
rootNode.remove(); | ||
}); | ||
|
||
it('should not render if items are empty', () => { | ||
const cornerToolbar = new CornerToolbar({ | ||
root: rootNode, | ||
items: [], | ||
}); | ||
cornerToolbar.render(); | ||
expect(rootNode.first().length).to.equal(0); | ||
}); | ||
|
||
}); |