Skip to content

Commit

Permalink
Merge pull request #20 from GreenTeaCake/fix-errors
Browse files Browse the repository at this point in the history
Fix test errors
  • Loading branch information
GreenTeaCake committed Apr 10, 2024
2 parents 170ee88 + 4a974f7 commit 43242d6
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions src/components/switch/test/switch.e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { newE2EPage } from '@stencil/core/testing';
describe('gtc-switch', () => {
it('renders', async () => {
const page = await newE2EPage();
await page.setContent('<gtc-switch></gtc-switch>');
await page.setContent('<gtc-switch label="Label"></gtc-switch>');

const element = await page.find('gtc-switch');
expect(element).toHaveClass('hydrated');
Expand All @@ -13,7 +13,7 @@ describe('gtc-switch', () => {
it('renders changes to the checked property', async () => {
const page = await newE2EPage();

await page.setContent('<gtc-switch checked="true"></gtc-switch>');
await page.setContent('<gtc-switch label="Label" checked="true"></gtc-switch>');
const component = await page.find('gtc-switch');
const element = await page.find('gtc-switch >>> div.gtc-switch');
expect(element.getAttribute('aria-checked')).toEqual(`true`);
Expand All @@ -32,7 +32,7 @@ describe('gtc-switch', () => {
it('renders changes to the checked property', async () => {
const page = await newE2EPage();

await page.setContent('<gtc-switch checked="false"></gtc-switch>');
await page.setContent('<gtc-switch label="Label" checked="false"></gtc-switch>');
const component = await page.find('gtc-switch');
const element = await page.find('gtc-switch >>> div.gtc-switch');
expect(element.getAttribute('aria-checked')).toEqual(`false`);
Expand All @@ -51,7 +51,7 @@ describe('gtc-switch', () => {
it('when checked', async () => {
const page = await newE2EPage();

await page.setContent('<gtc-switch checked="true"></gtc-switch>');
await page.setContent('<gtc-switch label="Label" checked="true"></gtc-switch>');

const gtcChange = await page.spyOnEvent('gtcChange');

Expand All @@ -66,7 +66,7 @@ describe('gtc-switch', () => {
it('when unchecked', async () => {
const page = await newE2EPage();

await page.setContent('<gtc-switch checked="false"></gtc-switch>');
await page.setContent('<gtc-switch label="Label" checked="false"></gtc-switch>');

const gtcChange = await page.spyOnEvent('gtcChange');

Expand All @@ -83,7 +83,9 @@ describe('gtc-switch', () => {
it('when checked', async () => {
const page = await newE2EPage();

await page.setContent('<gtc-switch checked="true" disabled="true"></gtc-switch>');
await page.setContent(
'<gtc-switch label="Label" checked="true" disabled="true"></gtc-switch>',
);

const gtcChange = await page.spyOnEvent('gtcChange');

Expand All @@ -97,7 +99,9 @@ describe('gtc-switch', () => {
it('when unchecked', async () => {
const page = await newE2EPage();

await page.setContent('<gtc-switch checked="false" disabled="true"></gtc-switch>');
await page.setContent(
'<gtc-switch label="Label" checked="false" disabled="true"></gtc-switch>',
);

const gtcChange = await page.spyOnEvent('gtcChange');

Expand Down

0 comments on commit 43242d6

Please sign in to comment.