forked from metabase/metabase
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of github.com:metabase/metabase into non-root-p…
…ath-v2
- Loading branch information
Showing
24 changed files
with
291 additions
and
66 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
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,8 @@ | ||
import { getRandomColor, normal } from 'metabase/lib/colors' | ||
|
||
describe('getRandomColor', () => { | ||
it('should return a color string from the proper family', () => { | ||
const color = getRandomColor(normal) | ||
expect(Object.values(normal)).toContain(color) | ||
}) | ||
}) |
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
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
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
38 changes: 38 additions & 0 deletions
38
frontend/src/metabase/questions/containers/CollectionEditorForm.spec.js
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,38 @@ | ||
import { | ||
getFormTitle, | ||
getActionText | ||
} from './CollectionEditorForm' | ||
|
||
const FORM_FIELDS = { | ||
id: { value: 4 }, | ||
name: { value: 'Test collection' }, | ||
color: { value: '#409ee3' }, | ||
initialValues: { | ||
color: '#409ee3' | ||
} | ||
} | ||
const NEW_COLLECTION_FIELDS = { ...FORM_FIELDS, id: '', color: '' } | ||
|
||
describe('CollectionEditorForm', () => { | ||
|
||
describe('Title', () => { | ||
it('should have a default title if no collection exists', () => | ||
expect(getFormTitle(NEW_COLLECTION_FIELDS)).toEqual('New collection') | ||
) | ||
|
||
it('should have the title of the colleciton if one exists', () => | ||
expect(getFormTitle(FORM_FIELDS)).toEqual(FORM_FIELDS.name.value) | ||
) | ||
}) | ||
|
||
describe('Form actions', () => { | ||
it('should have a "create" primary action if no collection exists', () => | ||
expect(getActionText(NEW_COLLECTION_FIELDS)).toEqual('Create') | ||
) | ||
|
||
it('should have an "update" primary action if no collection exists', () => | ||
expect(getActionText(FORM_FIELDS)).toEqual('Update') | ||
) | ||
}) | ||
|
||
}) |
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
Empty file.
Oops, something went wrong.