Skip to content

Commit

Permalink
text(legacy): remove legacy context/connect prop tests
Browse files Browse the repository at this point in the history
  • Loading branch information
adamdbradley committed Aug 4, 2020
1 parent fb8a02b commit 2089481
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 176 deletions.
40 changes: 0 additions & 40 deletions src/runtime/test/connect.spec.tsx

This file was deleted.

75 changes: 0 additions & 75 deletions src/runtime/test/context.spec.tsx

This file was deleted.

24 changes: 0 additions & 24 deletions src/runtime/test/legacy-props.spec.tsx

This file was deleted.

38 changes: 1 addition & 37 deletions src/runtime/test/queue.spec.tsx
@@ -1,5 +1,5 @@
import { newSpecPage } from '@stencil/core/testing';
import { Component, Method, Prop, readTask, writeTask } from '@stencil/core';
import { Component, Method, readTask, writeTask } from '@stencil/core';

describe('queue', () => {
it('should execute tasks in the right order', async () => {
Expand Down Expand Up @@ -29,40 +29,4 @@ describe('queue', () => {

expect(log).toEqual(' read1 read2 read3 write1 write2');
});

it('should replace default values of context', async () => {
@Component({
tag: 'cmp-a',
})
class CmpA {
@Prop({ context: 'resourcesUrl' }) resourcesUrl: boolean;
}
const { rootInstance } = await newSpecPage({
components: [CmpA],
html: `<cmp-a></cmp-a>`,
context: {
resourcesUrl: '/blabla',
},
});
expect(rootInstance.resourcesUrl).toEqual('/blabla');
});

it('should extend context', async () => {
@Component({
tag: 'cmp-a',
})
class CmpA {
@Prop({ context: 'value' }) value: number;
@Prop({ context: 'unknown' }) unknown: any;
}
const { rootInstance } = await newSpecPage({
components: [CmpA],
html: `<cmp-a></cmp-a>`,
context: {
value: 1234,
},
});
expect(rootInstance.value).toEqual(1234);
expect(rootInstance.unknown).toEqual(undefined);
});
});

0 comments on commit 2089481

Please sign in to comment.