This repository has been archived by the owner on Aug 2, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
…154)
- Loading branch information
1 parent
0fc7ebe
commit 4c83185
Showing
7 changed files
with
61 additions
and
21 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,7 +7,9 @@ | |
src="/images/logo.png" | ||
srcset="/images/logo.png 1x, /images/[email protected] 2x" | ||
/> | ||
<FdShellBarProduct>Fundamental Vue</FdShellBarProduct> | ||
<FdShellBarProduct> | ||
<FdShellBarProductTitle>Fundamental Vue</FdShellBarProductTitle> | ||
</FdShellBarProduct> | ||
</FdShellBarGroup> | ||
<FdShellBarGroup position="end"> | ||
<FdShellBarActions> | ||
|
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: 6 additions & 3 deletions
9
ui/src/components/Layout/ShellBar/ShellBarProductSwitcherItemImg.vue
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 |
---|---|---|
@@ -1,15 +1,18 @@ | ||
<template> | ||
<span class="fd-product-switcher__product-icon"> | ||
<img :src="src" /> | ||
<span class="fd-product-switcher__product-icon" v-on="$listeners"> | ||
<slot> | ||
<img :src="src" v-bind="$attrs" /> | ||
</slot> | ||
</span> | ||
</template> | ||
|
||
<script lang="ts"> | ||
import Vue from "vue"; | ||
export default Vue.extend({ | ||
name: "FdShellBarProductSwitcherItemImg", | ||
inheritAttrs: false, | ||
props: { | ||
src: { type: String, default: "" } | ||
src: String | ||
} | ||
}); | ||
</script> |
17 changes: 17 additions & 0 deletions
17
ui/src/components/Layout/ShellBar/__tests__/ShellBarLogo.test.ts
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 @@ | ||
import FdShellBarLogo from "./../ShellBarLogo.vue"; | ||
import { mount, createLocalVue } from "@vue/test-utils"; | ||
|
||
describe("ShellBarLogo", () => { | ||
// Test for https://github.com/SAP/fundamental-vue/issues/154 | ||
it("puts alt on logo", async () => { | ||
const localVue = createLocalVue(); | ||
const wrapper = mount({ | ||
components: { FdShellBarLogo }, | ||
template: `<FdShellBarLogo src="image.png" alt="helloWorld" />` | ||
}, { localVue }); | ||
await localVue.nextTick(); | ||
const img = wrapper.find("img"); | ||
expect(img.exists()).toBe(true); | ||
expect(img.attributes("alt")).toBe("helloWorld"); | ||
}) | ||
}); |
17 changes: 17 additions & 0 deletions
17
ui/src/components/Layout/ShellBar/__tests__/ShellBarProductSwitcherItemImg.test.ts
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 @@ | ||
import FdShellBarProductSwitcherItemImg from "./../ShellBarProductSwitcherItemImg.vue"; | ||
import { mount, createLocalVue } from "@vue/test-utils"; | ||
|
||
describe("ShellBarProductSwitcherItemImg", () => { | ||
// Test for https://github.com/SAP/fundamental-vue/issues/139 | ||
it("puts alt on logo", async () => { | ||
const localVue = createLocalVue(); | ||
const wrapper = mount({ | ||
components: { FdShellBarProductSwitcherItemImg }, | ||
template: `<FdShellBarProductSwitcherItemImg src="image.png" alt="helloWorld" />` | ||
}, { localVue }); | ||
await localVue.nextTick(); | ||
const img = wrapper.find("img"); | ||
expect(img.exists()).toBe(true); | ||
expect(img.attributes("alt")).toBe("helloWorld"); | ||
}) | ||
}); |
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