Skip to content

Commit

Permalink
attempt at loading css for cypress tests
Browse files Browse the repository at this point in the history
Signed-off-by: Polymeta <[email protected]>
  • Loading branch information
Polymeta committed Feb 17, 2023
1 parent 4930e54 commit f446976
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 4 deletions.
1 change: 1 addition & 0 deletions packages/ui/cypress/support/component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import "./commands";
// require('./commands')

import { mount as mount2 } from "cypress/vue2";
import "../../src/styles/main.scss";

// Augment the Cypress namespace to include type definitions for
// your custom command.
Expand Down
23 changes: 23 additions & 0 deletions packages/ui/src/components/general/loader/loader.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,18 @@ const CustomLoaderWrapper = defineComponent({
</div>`
});

/**
* Wrapper for testing the loader with a custom variant
*/
const VariantLoaderWrapper = defineComponent({
components: { ForgeLoader },

template: `
<div>
<forge-loader id="testLoader" variant="info" />
</div>`
});

/***************************************************
************* END OF WRAPPER SETUP ****************
**************************************************/
Expand Down Expand Up @@ -66,6 +78,17 @@ it("mounts custom loader", () => {
cy.get(".sr-only").should("have.text", CustomLoadingMessage);
});

/**
* Tests the custom loader mounts correctly with valid custom text
*/
it("mounts custom loader", () => {
cy.wait(500);
mount(VariantLoaderWrapper as any);
cy.get("#testLoader").should("exist");
cy.get("#testLoader").should("be.visible");
cy.get("#testLoader > span").should("have.class", "text-info");
});

/***************************************************
***************** END OF TESTS ********************
**************************************************/
2 changes: 1 addition & 1 deletion packages/ui/src/styles/datepicker.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@import 'node_modules/flatpickr/dist/flatpickr.min';
@import 'flatpickr/dist/flatpickr.min';

input.flatpickr-input[readonly],
.flatpickr-wrapper input.form-control[readonly] {
Expand Down
4 changes: 2 additions & 2 deletions packages/ui/src/styles/forge.scss
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
@import "variables";
@import 'node_modules/bootstrap/scss/bootstrap';
@import 'node_modules/bootstrap-vue/src/index.scss';
@import 'bootstrap/scss/bootstrap';
@import 'bootstrap-vue/src/index.scss';


@each $color, $value in $grays {
Expand Down
2 changes: 1 addition & 1 deletion packages/ui/src/styles/multiselect.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@import 'node_modules/vue-multiselect/dist/vue-multiselect.min';
@import 'vue-multiselect/dist/vue-multiselect.min';

.multiselect {
box-sizing: content-box;
Expand Down

0 comments on commit f446976

Please sign in to comment.