-
-
Notifications
You must be signed in to change notification settings - Fork 44
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #93 from talvbansal/dayjs
Replace moment.js with day.js
- Loading branch information
Showing
35 changed files
with
3,330 additions
and
98 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
{ | ||
"presets": [ | ||
["env", { | ||
"modules": "commonjs", | ||
"targets": { | ||
"browsers": ["> 1%", "last 2 versions", "ie >= 10"] | ||
} | ||
}], | ||
"stage-2" | ||
], | ||
"env": { | ||
"test": { | ||
"presets": ["env", "stage-2"], | ||
"plugins": ["istanbul"] | ||
} | ||
} | ||
} |
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file.
Empty file.
Large diffs are not rendered by default.
Oops, something went wrong.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file.
Empty file.
Empty file.
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.
Empty file modified
0
resources/assets/js/components/subcomponents/ConfirmDeleteModal.vue
100644 → 100755
Empty file.
Empty file modified
0
resources/assets/js/components/subcomponents/CreateFolderModal.vue
100644 → 100755
Empty file.
Empty file.
Empty file modified
0
resources/assets/js/components/subcomponents/MoveItemModal.vue
100644 → 100755
Empty file.
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 modified
0
resources/assets/js/components/subcomponents/RenameItemModal.vue
100644 → 100755
Empty file.
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.
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
9 changes: 9 additions & 0 deletions
9
resources/assets/js/mixins/file-manager-mixin.js
100644 → 100755
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.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,43 @@ | ||
import { shallow } from "@vue/test-utils"; | ||
import PreviewSideBar from "./../../../resources/assets/js/components/subcomponents/PreviewSideBar.vue"; | ||
import dayjs from "dayjs"; | ||
|
||
describe("Preview Sidebar", () => { | ||
const wrapper = shallow(PreviewSideBar); | ||
|
||
it("it shows a file summary", () => { | ||
wrapper.setProps({ | ||
currentFile:{ | ||
name: "TestFile.jpg", | ||
size: (1024 * 1024 * 32), | ||
mimeType: "image/jpg", | ||
webPath: "https://localhost/TestFile.jpg", | ||
relativePath: "/TestFile.jpg", | ||
modified: { | ||
date: dayjs("2018-03-19") | ||
} | ||
} | ||
}); | ||
|
||
expect(wrapper.html().indexOf( | ||
`<img id="easel-preview-image" src="https://localhost/TestFile.jpg" class="img-responsive center-block">` | ||
) !== -1).toBe(true); | ||
|
||
expect(wrapper.html().indexOf( | ||
`<td class="description">Name</td> <td class="file-value">TestFile.jpg</td>` | ||
) !== -1).toBe(true); | ||
|
||
expect(wrapper.html().indexOf( | ||
`<td class="description">Size</td> <td class="file-value">32 MB</td>` | ||
) !== -1).toBe(true); | ||
|
||
expect(wrapper.html().indexOf( | ||
`<td class="description">URL</td> <td class="file-value"><a href="https://localhost/TestFile.jpg" target="_blank" rel="noopener">/TestFile.jpg</a></td>` | ||
) !== -1).toBe(true); | ||
|
||
expect(wrapper.html().indexOf( | ||
`<td class="description">Uploaded On</td> <td class="file-value">19/03/2018 12:00:00 AM</td>` | ||
) !== -1).toBe(true); | ||
}) | ||
|
||
}); |
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,67 @@ | ||
import { shallow } from "@vue/test-utils"; | ||
import TopToolBar from "./../../../resources/assets/js/components/subcomponents/TopToolBar.vue"; | ||
|
||
describe("TopToolBar", () => { | ||
const wrapper = shallow(TopToolBar); | ||
|
||
it("it has the correct buttons", () => { | ||
const toolBarAsText = wrapper.text(); | ||
expect(toolBarAsText).toContain("Upload"); | ||
expect(toolBarAsText).toContain("Add folder"); | ||
|
||
expect(toolBarAsText).toContain("Refresh"); | ||
|
||
expect(toolBarAsText).toContain("Move"); | ||
expect(toolBarAsText).toContain("Delete"); | ||
expect(toolBarAsText).toContain("Rename"); | ||
}) | ||
|
||
it("emits the open-modal-create-folder event when add folder button is clicked", () => { | ||
const reloadButton = wrapper.find("button[title='Add folder']"); | ||
reloadButton.trigger("click"); | ||
expect(wrapper.emitted("open-modal-create-folder")).toBeTruthy(); | ||
}) | ||
|
||
it("emits the reload-folder event when reload button is clicked", () => { | ||
const reloadButton = wrapper.find("button[title='Refresh']"); | ||
reloadButton.trigger("click"); | ||
expect(wrapper.emitted("reload-folder")).toBeTruthy(); | ||
}) | ||
|
||
it("emits the open-modal-move-item event when move button is clicked", () => { | ||
wrapper.setProps({ | ||
currentFile : { | ||
name: "/test.jpg", | ||
} | ||
}) | ||
|
||
const reloadButton = wrapper.find("button[title='Move']"); | ||
reloadButton.trigger("click"); | ||
expect(wrapper.emitted("open-modal-move-item")).toBeTruthy(); | ||
}) | ||
|
||
it("emits the open-modal-delete-item event when delete button is clicked", () => { | ||
wrapper.setProps({ | ||
currentFile : { | ||
name: "/test.jpg", | ||
} | ||
}) | ||
|
||
const reloadButton = wrapper.find("button[title='Delete']"); | ||
reloadButton.trigger("click"); | ||
expect(wrapper.emitted("open-modal-delete-item")).toBeTruthy(); | ||
}) | ||
|
||
it("emits the open-modal-rename-item event when rename button is clicked", () => { | ||
wrapper.setProps({ | ||
currentFile : { | ||
name: "/test.jpg", | ||
} | ||
}) | ||
|
||
const reloadButton = wrapper.find("button[title='Rename']"); | ||
reloadButton.trigger("click"); | ||
expect(wrapper.emitted("open-modal-rename-item")).toBeTruthy(); | ||
}) | ||
|
||
}); |
Empty file.
Empty file.
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
Oops, something went wrong.