mirror of
https://github.com/apache/superset.git
synced 2026-04-20 00:24:38 +00:00
fix: copy to Clipboard order (#16299)
* copy to Clipboard order * centralized copyToClipboard * fixed table order * fixed tests * added colnames to all viz types * added colnames to all viz types * added colnames to all viz types
This commit is contained in:
@@ -42,9 +42,10 @@ const data = [
|
||||
[unicodeKey]: unicodeKey,
|
||||
},
|
||||
];
|
||||
const all_columns = ['col01', 'col02', 'col03', asciiKey, unicodeKey];
|
||||
|
||||
test('useTableColumns with no options', () => {
|
||||
const hook = renderHook(() => useTableColumns(data));
|
||||
const hook = renderHook(() => useTableColumns(all_columns, data));
|
||||
expect(hook.result.current).toEqual([
|
||||
{
|
||||
Cell: expect.any(Function),
|
||||
@@ -83,7 +84,7 @@ test('useTableColumns with no options', () => {
|
||||
|
||||
test('use only the first record columns', () => {
|
||||
const newData = [data[3], data[0]];
|
||||
const hook = renderHook(() => useTableColumns(newData));
|
||||
const hook = renderHook(() => useTableColumns(all_columns, newData));
|
||||
expect(hook.result.current).toEqual([
|
||||
{
|
||||
Cell: expect.any(Function),
|
||||
@@ -134,7 +135,9 @@ test('use only the first record columns', () => {
|
||||
});
|
||||
|
||||
test('useTableColumns with options', () => {
|
||||
const hook = renderHook(() => useTableColumns(data, { col01: { id: 'ID' } }));
|
||||
const hook = renderHook(() =>
|
||||
useTableColumns(all_columns, data, { col01: { id: 'ID' } }),
|
||||
);
|
||||
expect(hook.result.current).toEqual([
|
||||
{
|
||||
Cell: expect.any(Function),
|
||||
|
||||
Reference in New Issue
Block a user