mirror of
https://github.com/balzack/databag.git
synced 2025-02-14 12:39:17 +00:00
Revert "fixing unit test with custom attribute"
This reverts commit 66729cfc60
.
This commit is contained in:
parent
89217cd441
commit
d38d60119b
@ -20,7 +20,7 @@ function CardView() {
|
||||
<div
|
||||
key={entry.id}
|
||||
data-testid="card"
|
||||
data-offsync={entry.offsync.toString()}
|
||||
offsync={entry.offsync.toString()}
|
||||
>
|
||||
<span data-testid="name">{entry.data.cardProfile.name}</span>
|
||||
<span data-testid="status">{entry.data.cardDetail.status}</span>
|
||||
@ -36,8 +36,8 @@ function CardView() {
|
||||
//@ts-ignore
|
||||
<div
|
||||
data-testid="cards"
|
||||
data-count={renderCount}
|
||||
data-offsync={card.state.offsync.toString()}
|
||||
count={renderCount}
|
||||
offsync={card.state.offsync.toString()}
|
||||
>
|
||||
{cards}
|
||||
</div>
|
||||
@ -137,7 +137,7 @@ test('resync cards', async () => {
|
||||
|
||||
await waitFor(async () => {
|
||||
//@ts-ignore
|
||||
expect(screen.getByTestId('cards').attributes['data-offsync'].value).toBe('true');
|
||||
expect(screen.getByTestId('cards').attributes.offsync.value).toBe('true');
|
||||
});
|
||||
|
||||
statusCards = 200;
|
||||
@ -148,7 +148,7 @@ test('resync cards', async () => {
|
||||
|
||||
await waitFor(async () => {
|
||||
//@ts-ignore
|
||||
expect(screen.getByTestId('cards').attributes['data-offsync'].value).toBe('false');
|
||||
expect(screen.getByTestId('cards').attributes.offsync.value).toBe('false');
|
||||
});
|
||||
|
||||
act(() => {
|
||||
@ -216,7 +216,7 @@ test('resync contact', async () => {
|
||||
|
||||
await waitFor(async () => {
|
||||
//@ts-ignore
|
||||
expect(screen.getByTestId('card').attributes['data-offsync'].value).toBe('true');
|
||||
expect(screen.getByTestId('card').attributes.offsync.value).toBe('true');
|
||||
});
|
||||
|
||||
statusMessage = 200;
|
||||
@ -227,7 +227,7 @@ test('resync contact', async () => {
|
||||
|
||||
await waitFor(async () => {
|
||||
//@ts-ignore
|
||||
expect(screen.getByTestId('card').attributes['data-offsync'].value).toBe('false');
|
||||
expect(screen.getByTestId('card').attributes.offsync.value).toBe('false');
|
||||
});
|
||||
|
||||
act(() => {
|
||||
|
@ -33,8 +33,8 @@ function ChannelView() {
|
||||
//@ts-ignore
|
||||
<div
|
||||
data-testid="channels"
|
||||
data-count={renderCount}
|
||||
data-offsync={channel.state.offsync.toString()}
|
||||
count={renderCount}
|
||||
offsync={channel.state.offsync.toString()}
|
||||
>
|
||||
{channels}
|
||||
</div>
|
||||
@ -204,7 +204,7 @@ test('add, update and remove channel', async () => {
|
||||
await channelContext.actions.setRevision(1);
|
||||
});
|
||||
|
||||
//screen.getByTestId('count').attributes['data-count'].value
|
||||
//screen.getByTestId('count').attributes.count.value
|
||||
//console.log(prettyDOM(screen.getByTestId('channels')));
|
||||
|
||||
await waitFor(async () => {
|
||||
@ -213,11 +213,8 @@ test('add, update and remove channel', async () => {
|
||||
expect(screen.getByTestId('summary').textContent).toBe('testdata');
|
||||
});
|
||||
|
||||
console.log("GET CHANNELS");
|
||||
console.log(screen.getByTestId('channels'));
|
||||
|
||||
//@ts-ignore
|
||||
const count = parseInt(screen.getByTestId('channels').attributes['data-count'].value) + 1;
|
||||
const count = parseInt(screen.getByTestId('channels').attributes.count.value) + 1;
|
||||
|
||||
fetchChannels = [
|
||||
{
|
||||
@ -239,7 +236,7 @@ console.log(screen.getByTestId('channels'));
|
||||
expect(screen.getByTestId('channels').children).toHaveLength(1);
|
||||
expect(screen.getByTestId('detail').textContent).toBe('testdata2');
|
||||
//@ts-ignore
|
||||
expect(screen.getByTestId('channels').attributes['data-count'].value).toBe(count.toString());
|
||||
expect(screen.getByTestId('channels').attributes.count.value).toBe(count.toString());
|
||||
});
|
||||
|
||||
fetchChannels = [{ id: '123', revision: 3 }];
|
||||
@ -262,7 +259,7 @@ console.log(screen.getByTestId('channels'));
|
||||
|
||||
await waitFor(async () => {
|
||||
//@ts-ignore
|
||||
expect(screen.getByTestId('channels').attributes['data-offsync'].value).toBe('false');
|
||||
expect(screen.getByTestId('channels').attributes.offsync.value).toBe('false');
|
||||
});
|
||||
|
||||
await act(async () => {
|
||||
@ -288,7 +285,7 @@ test('resync', async () => {
|
||||
|
||||
await waitFor(async () => {
|
||||
//@ts-ignore
|
||||
expect(screen.getByTestId('channels').attributes['data-offsync'].value).toBe('true');
|
||||
expect(screen.getByTestId('channels').attributes.offsync.value).toBe('true');
|
||||
});
|
||||
|
||||
await act(async () => {
|
||||
@ -298,6 +295,6 @@ test('resync', async () => {
|
||||
|
||||
await waitFor(async () => {
|
||||
//@ts-ignore
|
||||
expect(screen.getByTestId('channels').attributes['data-offsync'].value).toBe('false');
|
||||
expect(screen.getByTestId('channels').attributes.offsync.value).toBe('false');
|
||||
});
|
||||
});
|
||||
|
@ -45,7 +45,7 @@ function ContactsView() {
|
||||
//@ts-ignore
|
||||
<div
|
||||
data-testid="cards"
|
||||
data-count={renderCount}
|
||||
count={renderCount}
|
||||
>
|
||||
{cards}
|
||||
</div>
|
||||
|
@ -42,8 +42,8 @@ function ConversationView() {
|
||||
//@ts-ignore
|
||||
<div
|
||||
data-testid="topics"
|
||||
data-count={renderCount}
|
||||
data-offsync={card.state.offsync.toString()}
|
||||
count={renderCount}
|
||||
offsync={card.state.offsync.toString()}
|
||||
>
|
||||
{topics}
|
||||
</div>
|
||||
|
@ -27,7 +27,7 @@ function InfoView() {
|
||||
//@ts-ignore
|
||||
<div
|
||||
data-testid="info"
|
||||
data-count={renderCount}
|
||||
count={renderCount}
|
||||
>
|
||||
{state.title}
|
||||
</div>
|
||||
|
@ -37,7 +37,7 @@ function ListingView() {
|
||||
//@ts-ignore
|
||||
<div
|
||||
data-testid="contacts"
|
||||
data-count={renderCount}
|
||||
count={renderCount}
|
||||
>
|
||||
{contacts}
|
||||
</div>
|
||||
|
@ -43,7 +43,7 @@ function ThreadView() {
|
||||
//@ts-ignore
|
||||
<div
|
||||
data-testid="thread"
|
||||
data-count={renderCount}
|
||||
count={renderCount}
|
||||
>
|
||||
{topics}
|
||||
</div>
|
||||
|
@ -48,7 +48,7 @@ function TopicsView() {
|
||||
//@ts-ignore
|
||||
<div
|
||||
data-testid="channels"
|
||||
data-count={renderCount}
|
||||
count={renderCount}
|
||||
>
|
||||
{channels}
|
||||
</div>
|
||||
|
@ -29,7 +29,7 @@ function ProfileView() {
|
||||
//@ts-ignore
|
||||
<div
|
||||
data-testid="name"
|
||||
data-count={renderCount}
|
||||
count={renderCount}
|
||||
>
|
||||
{name}
|
||||
</div>
|
||||
|
Loading…
Reference in New Issue
Block a user