Skip to content

Commit

Permalink
Fix unit test and minor UI layout issue
Browse files Browse the repository at this point in the history
  • Loading branch information
kyle1morel committed Oct 19, 2023
1 parent 1d01bd3 commit 95457fc
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 10 deletions.
6 changes: 3 additions & 3 deletions app/src/components/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const log = getLogger(module.filename);
* @see {@link https://stackoverflow.com/a/34518749}
* @returns {string} The git revision hash, or empty string
*/
export function getGitRevision(): string | undefined {
export function getGitRevision(): string {
try {
const gitDir = (() => {
let dir = '.git',
Expand All @@ -26,14 +26,14 @@ export function getGitRevision(): string | undefined {
.toString()
.trim();

let fileRead: string | undefined = undefined;
let fileRead: string = '';
if (head.indexOf(':') === -1) {
fileRead = readFileSync(join(__dirname, `${gitDir}/${head.substring(5)}`), 'utf8')
.toString()
.trim();
}

return head.indexOf(':') === -1 ? head : fileRead;
return head.indexOf(':') === -1 ? head : (fileRead as string);
// eslint-disable-next-line @typescript-eslint/no-explicit-any
} catch (err: any) {
log.warn(err.message, { function: 'getGitRevision' });
Expand Down
10 changes: 5 additions & 5 deletions frontend/src/components/bucket/BucketSidebar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -88,14 +88,14 @@ watch(props, () => {
<div class="col-12">
<h2 class="font-bold">Properties</h2>
</div>
<div class="grid overflow-hidden">
<div class="col-fixed">Bucket Name:</div>
<div class="col-12 grid overflow-hidden">
<div class="col-fixed pr-1">Bucket Name:</div>
<div class="col wrap-block w-6">
{{ props.sidebarInfo?.bucketName }}
</div>
</div>
<div class="grid">
<div class="col-fixed">Bucket ID:</div>
<div class="col-12 grid">
<div class="col-fixed pr-1">Bucket ID:</div>
<div class="col">
{{ props.sidebarInfo?.bucketId }}
</div>
Expand All @@ -106,7 +106,7 @@ watch(props, () => {
<h2 class="font-bold">Access</h2>
</div>
<div class="grid">
<div class="col-fixed">Managed by:</div>
<div class="col-fixed pr-1">Managed by:</div>
<div class="col">
{{ managedBy }}
</div>
Expand Down
5 changes: 3 additions & 2 deletions frontend/tests/unit/components/bucket/BucketSidebar.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,9 @@ describe('BucketSidebar.vue', async () => {
wrapper.findAll('div').forEach((ele) => {
textArray.push(ele.text());
});
expect(textArray).toContain(`Bucket ID: ${testSidebarInfo.bucketId}`);
expect(textArray).toContain(`Bucket Name: ${testSidebarInfo.bucketName}`);

expect(textArray).toContain(`Bucket ID:${testSidebarInfo.bucketId}`);
expect(textArray).toContain(`Bucket Name:${testSidebarInfo.bucketName}`);
});

it('emits close modal', async () => {
Expand Down

0 comments on commit 95457fc

Please sign in to comment.