-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs: fbadge documentation added (refs SFKUI-7023)
- Loading branch information
Showing
10 changed files
with
170 additions
and
0 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 |
---|---|---|
|
@@ -42,3 +42,7 @@ FBadgeLiveExample.vue | |
:::api | ||
vue:FBadge | ||
::: | ||
|
||
## Relaterat | ||
|
||
- {@link FBadgePageObject FBadgePageObject} |
18 changes: 18 additions & 0 deletions
18
docs/functions/cypress/pageobjects/FBadgePageObject/FBadgePageObject-is-inverted.cy.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,18 @@ | ||
import { FBadgePageObject } from "@fkui/vue/pageobject"; | ||
import Example from "./FBadgePageObject-is-inverted.vue"; | ||
|
||
it("should check if the badge is inverted or not ", () => { | ||
cy.mount(Example); | ||
|
||
/* --- cut above --- */ | ||
const myBadgeNotIverted = new FBadgePageObject( | ||
"[data-test=my-badge-not-inverted]", | ||
); | ||
myBadgeNotIverted.isInverted().should("be.equal", false); | ||
|
||
const myBadgeInverted = new FBadgePageObject( | ||
"[data-test=my-badge-inverted]", | ||
); | ||
myBadgeInverted.isInverted().should("be.equal", true); | ||
/* --- cut below --- */ | ||
}); |
32 changes: 32 additions & 0 deletions
32
.../functions/cypress/pageobjects/FBadgePageObject/FBadgePageObject-is-inverted.md
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,32 @@ | ||
--- | ||
name: FFileItemPageObject.inverted | ||
title: "FFileItemPageObject: inverted() method" | ||
short-title: inverted() | ||
layout: article | ||
--- | ||
|
||
Används för att komma åt status om brickan är inverterad eller inte. | ||
|
||
## Syntax | ||
|
||
```ts | ||
inverted(); | ||
``` | ||
|
||
### Returvärde | ||
|
||
`Boolean` ger tillbaka status på brickan om den är inverterad eller inte. | ||
|
||
## Exempel | ||
|
||
```import static | ||
FBadgePageObject-is-inverted.vue | ||
``` | ||
|
||
```import | ||
FBadgePageObject-is-inverted.cy.ts | ||
``` | ||
|
||
## Relaterat | ||
|
||
- {@link FBadge} |
12 changes: 12 additions & 0 deletions
12
docs/functions/cypress/pageobjects/FBadgePageObject/FBadgePageObject-is-inverted.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 |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<script setup lang="ts"> | ||
import { FBadge } from "@fkui/vue"; | ||
</script> | ||
|
||
<template> | ||
<div> | ||
<f-badge v-test="'my-badge-not-inverted'" :status="'info'" :inverted="false"> My Not Inverted Badge </f-badge> | ||
</div> | ||
<div> | ||
<f-badge v-test="'my-badge-inverted'" :status="'info'" :inverted="true"> My Inverted Badge </f-badge> | ||
</div> | ||
</template> |
11 changes: 11 additions & 0 deletions
11
docs/functions/cypress/pageobjects/FBadgePageObject/FBadgePageObject-status.cy.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,11 @@ | ||
import { FBadgePageObject } from "@fkui/vue/pageobject"; | ||
import Example from "./FBadgePageObject-status.vue"; | ||
|
||
it("Should match the status warning in the badge", () => { | ||
cy.mount(Example); | ||
|
||
/* --- cut above --- */ | ||
const myBadge = new FBadgePageObject("[data-test=my-badge-warning]"); | ||
myBadge.status().should("be.equal", "warning"); | ||
/* --- cut below --- */ | ||
}); |
32 changes: 32 additions & 0 deletions
32
docs/functions/cypress/pageobjects/FBadgePageObject/FBadgePageObject-status.md
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,32 @@ | ||
--- | ||
name: FFileItemPageObject.status | ||
title: "FFileItemPageObject: status() method" | ||
short-title: status() | ||
layout: article | ||
--- | ||
|
||
Används för att komma åt en statusens namn på brickan. | ||
|
||
## Syntax | ||
|
||
```ts | ||
status(); | ||
``` | ||
|
||
### Returvärde | ||
|
||
`String` som innehåller en del av klassnamnet på brickans namn som `default`, `warning`, `error`, `success` eller `info`. | ||
|
||
## Exempel | ||
|
||
```import static | ||
FBadgePageObject-status.vue | ||
``` | ||
|
||
```import | ||
FBadgePageObject-status.cy.ts | ||
``` | ||
|
||
## Relaterat | ||
|
||
- {@link FBadge} |
7 changes: 7 additions & 0 deletions
7
docs/functions/cypress/pageobjects/FBadgePageObject/FBadgePageObject-status.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 |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<script setup lang="ts"> | ||
import { FBadge } from "@fkui/vue"; | ||
</script> | ||
|
||
<template> | ||
<f-badge v-test="'my-badge-warning'" :status="'warning'"> MyBadge </f-badge> | ||
</template> |
12 changes: 12 additions & 0 deletions
12
docs/functions/cypress/pageobjects/FBadgePageObject/FBadgePageObject.cy.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,12 @@ | ||
import { FBadgePageObject } from "@fkui/vue/pageobject"; | ||
import Example from "./FBadgePageObject.vue"; | ||
|
||
it("Should show the status default and that the badge is not inverted", () => { | ||
cy.mount(Example); | ||
|
||
/* --- cut above --- */ | ||
const myBadge = new FBadgePageObject("[data-test=my-badge]"); | ||
myBadge.status().should("be.equal", "default"); | ||
myBadge.isInverted().should("be.equal", false); | ||
/* --- cut below --- */ | ||
}); |
35 changes: 35 additions & 0 deletions
35
docs/functions/cypress/pageobjects/FBadgePageObject/FBadgePageObject.md
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,35 @@ | ||
--- | ||
name: FBadgePageObject | ||
title: "FBadgePageObject: FBadgePageObject() constructor" | ||
short-title: FBadgePageObject() | ||
sortorder: 1 | ||
layout: article | ||
--- | ||
|
||
Använd `FBadgePageObject` för att hämta information relaterat till {@link FBadge bricka }. | ||
|
||
## Syntax | ||
|
||
```ts | ||
new FBadgePageObject(selector); | ||
``` | ||
|
||
### Parametrar | ||
|
||
`selector: string` | ||
: Selector till `FBadge` elementet. Du kan med fördel använda {@link TestPlugin `v-test`} direktivet för din selector. | ||
|
||
## Exempel | ||
|
||
```import static | ||
FBadgePageObject.vue | ||
``` | ||
|
||
```import | ||
FBadgePageObject.cy.ts | ||
``` | ||
|
||
## Relaterat | ||
|
||
- {@link FBadge} | ||
- {@link TestPlugin} |
7 changes: 7 additions & 0 deletions
7
docs/functions/cypress/pageobjects/FBadgePageObject/FBadgePageObject.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 |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<script setup lang="ts"> | ||
import { FBadge } from "@fkui/vue"; | ||
</script> | ||
|
||
<template> | ||
<f-badge v-test="'my-badge'"> MyBadge </f-badge> | ||
</template> |